The reality is a little bit more boring than that, both statements that attack or defense win you title is kind of wrong. It's simply a matter of balance and will depend on the personnel at your disposal, in the end the best teams will try to score as many goals as possible while conceding as little as possible and the way you do that depends on who you have in your team.
If your best players are defenders you can do what Mourinho or Simeone respectively did with Chelsea and Atletico, you will win titles and be almost unbreakable as long as you are able to regularly not concede goals. The same is true for teams that have their strength up top, like Barcelona or some of the older United, in that case you will rely on your ability to easily create and score goals. Both work in the league because at least 30 of your games will be played against teams that are supposed to be inferior to you and that can't handle your main strength but things get a little bit more complicated in cup competitions because match ups will have a big importance, no team is able to deal with everything.