The 49ers don't have a great secondary, but they get around that by playing a lot of Cover 2. They have stud LBs who can cover so much ground in the middle of the field, all they have to do is play umbrella coverage on the back end and the pressure they get in the front 7 is enough that it works.
No defense in the league is flawless. That's the FA era, you're not gonna have a perfect team. The 49ers are probably the closest thing to a complete team the league has.