Why is the Ruy Lopez a sensible opening for white? As an amateur, I prefer the Scotch game as opposed to Ruy Lopez, since I feel that White loses tempo and Black seems to gain tempo with queenside counterplay in the main line.

 [title "Ruy Lopez"]
 [fen "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"]

 1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 {Bishop retreat at the expense of black gaining one queenside counterplay} b5 5. Bb3 {Another bishop retreat at the expense of black gaining a good queenside counterplay}


At the end of White's fifth move, it looks like Black is couple of tempo ahead and already has queenside counterplay going. Despite this, why is this one of (if not the most) celebrated openings? Can someone offer an explanation at the level of an amateur?
Sure black's a6-b5 come with tempo, but let's say at a very basic level, if you just compare pieces, structure and development progress, you can see that white is:


Ready to castle whereas black hasn't yet developed either kingside pieces, so at least 2 tempi away from castling. This translates into white having a safer king 1-2 tempi earlier, which means white has the upper-hand in launching some sort of attack or push.
White has developed two minor pieces that stand quite well: Knight on f3 attacks e5 and has the potential to coordinate on f7 with the bishop on b3 already eyeing black's kingside. In contrast, black has only developed a knight, one that stands defensively on c6 covering e5.
Besides the e4 pawn, white has nearly kept all pawn advancement options still on the table (therefore, can opt for various pawn structures still), whereas black has made 2 additional commitments that cannot be undone, which can on the one hand, prove to have been self-inducing weaknesses, and on the other hand, be hooks (targets) for white's pawn advancements on the queenside, e.g. an a4 push, to which black has to react immediately.


These ways of reasoning can be adopted to conceptually assess nearly any opening you see, at least at a basic level. 

The point on pawn commitments cannot be emphasized enough, they're the most committal moves in the game (trades come close but at least in principle a piece can be brought back to life with a promotion, but pawns cannot! :P ). Even at the highest level, for instance take a look at any of Caruana's openings in the match so far, where roughly speaking, he intentionally favours lines where he can delay unnecessary pawn moves and keep most of his options open. Examples: 

Game 2:

 [title "Game 2, move 13, only 3 central pawns moved, compare to white!"]
 [fen "r1br2k1/pp3ppp/2n1p3/q1bp4/2P2B2/P1P1PN2/2Q1BPPP/3R1RK1 b - - 0 13"]


Game 4:

 [title "Game 4, move 13, only 2 central pawns moved, compare to white!"]
 [fen "r1bqr1k1/ppp2ppp/3b4/4p3/1P6/2BP1BP1/P3PP1P/1R1Q1RK1 b - - 0 13"]


game 6:

 [title "Game 6, move 13, only 2 central pawns moved, compare to white!"]
 [fen "r1b1kb1r/pppn1ppp/3pn3/3N4/3P4/N1P2P2/PP4PP/R1B1KB1R b KQkq - 0 13"]


game 8:

 [title "Game 8, move 16, only 3 pawns moved, compare to black!"]
 [fen "1rbq1rk1/1p2b1pp/pN1p4/P2Pnp2/4p3/8/1PPBBPPP/R2Q1RK1 w - - 4 17"]


Anyhow I think the idea is clear now! It's important to add that in all these examples, the simple fact of having moved less pawns doesn't directly or necessarily translate into having a better position, chess is never that simple or linear. Partly, specially in this examples, it is a case of style and preference (and thus the adopted openings), but on the other hand it shows you the importance of diversity in pawn structures that can still be opted for as they translate into having more choices, abundantly clear even at the highest level.

I hope these ideas have shown you why the Ruy Lopez is such a liked opening, which I have only tackled from the white side in this post, and clearly, black's side has its own merits in the Ruy Lopez compared to alternative options that are available for black against 1. e4, but that's a discussion for another time.