Well first of all, I think 4. Bxc6 is definitely a playable move. Many strong players have tried it. But they don't do it to win a pawn because it doesn't win a pawn.
So for instance after the line you gave with 4...dxc6 5. Nxe5 black can choose either Qd4 or Qg5 and in both cases black just wins the pawn back instantly by making a fork.
If 5. Nxe5 doesn't win a pawn, then it doesn't make sense for white to play it, because then the position just opens up and black's bishop pair is gonna become more of a factor. So usually the Bxc6 lines are a bit more positional than that. But anyway
4. Ba4 keeps the idea alive of *potentially* taking on c6/e5 later. Maybe it could be a thing someday, even if it isn't right now. Like when white castles, it could be a stronger idea because then if black goes after white's e-pawn in return white may have d4/Re1 and expose the open e-file towards black's king. Something like that. It's complicated but the point is
a) Bxc6/Nxe5 right away does not win a pawn
b) strong players, such as Stockfish, sometimes prefer keeping the tension (and the bishop pair)
This of course doesn't mean that Bxc6 in itself isn't a very good move that any master could have as a part of their repertoire with success.
After 1.e4 e5 2.Nf3 Nc6 3.Bb5 a3, why is the recommended move by stockfish 4.Ba4, instead of 4.Bxc6 since the whole point of the Ruy Lopez is to attack white's only defender of e5? Isn't e5 a hanging pawn after black recaptures the bishop?