Analysis of a very complicated end position - why is this move leading to a draw? I am trying to understand this position a bit better and would appreciate some help in doing so. I am black and it's my turn... (the board is flipped .. ie. black plays up and white plays down)

[FEN "8/4Kp2/4p3/4k1p1/8/8/5PP1/8 b - - 0 48"]

1...f5??  {This is what I played, although it's marked as a bad move: -0.5} (1... f6! {ok move -8}) (1... Kf5!! {best move -17}) * 


I played 48...f5, which dropped my score from -17 to -0.6, basically throwing a winning situation away.

I have been reviewing this position for quite some time now but can't figure out exactly why this move was wrong. There are only 2 winning moves from here: Kf5 or f6. So what wrong with f5? (I assume something like opposition, but this is too complex for me to see)

Can someone please shed some light for me on the strategy involved? (thanks)
The reason why you lose the winning edge is, as it almost always is, because of tempi:

[fen "8/4Kp2/4p3/4k1p1/8/8/5PP1/8 b - - 0 1"]


1...f5? 2.Kf7, g4 3.g3!, Kd6 4. Kg6! (4.Kf6?, Kd5 5. Kg6, Ke4! 6.Kf6,  e5 7.Kg5, Kf3 {and black picks up the f2 pawn.})
4...Kd5 5. Kf6 {and black cannot advance without giving up a vital pawn.}


Let's look at what happens when playing ...f6 first:

[fen "8/4Kp2/4p3/4k1p1/8/8/5PP1/8 b - - 0 1"]


1...f6 2.Kf7, g4 3.g3 (3. Kg6, f5! 4. Kf7, {For 4. g3, see the variations above; it's a transposition.} 4...f4 {and white is helpless against the black pawns.})
3...Kf5 4.Ke7, e5 5.Kf7 (5.Kd6, Ke4! 6. Ke6, f5 {and white is toast.})

5...e4 6.Ke7 (6.Kg7, Kg5!) 6...Ke5! {denying the white king access to the action.} 7.Kf7, f5 8. Kg6, f4 {and black breaks through.}


So basically what happens is that ...f6 loses a tempo on purpose, to deny white the blockading idea available after ...f5. It's not easy to see immediately, but it's worth noting, as ideas like manipulating tempi in pawn endgames is the key to playing them successfully. Remember this in your next pawn endgame, as it could gain you an extra half point.

So, what about ...Kf5? It also wins:

[fen "8/4Kp2/4p3/4k1p1/8/8/5PP1/8 b - - 0 1"]


1...Kf5 2. Kxf7 (2.f3, g4!? 3. Kxf7, e5 4. Kg7 (4.Ke7, g3! 5. Kd6, e4 {and black breaks through.}) 4...Kf4! 5.Kf6, g3! 6. Kg6, Ke3! {and black picks up g2 and the victory.}) 2...e5 3.Ke7, e4! (3...g4? 4.g3!, e4 5.Kf7!, e3 6.fxe3, Ke4 7.Kf6, Kxe3? 8.Kg5, Kf3 9.Kh4 {and white wins. Oops!})
4.Kd6, g4 5.Kd5, g3 {and black wins.}


These lines aren't exhaustive, but I think that I've outlined the most important variations. 

With this I hope that I've been able to show that in pawn endgames, general principles only serve to guide you. You must calculate precisely!