Q:

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) 

A:

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!

A:

I am not sure I can give a simple reason why this leads to a draw (though I try below), but I think there are at least clear reasons that f6 is much better; for practical purposes this should be good enough, though it is certainly also interesting to clearly understand why the position after f5 is drawn.
The specifics that make this position winning is that

you have an active king and a pawn majority
the opposing king is off-side; it should be in front of your pawns, not behind them in order to block their advance and enter a drawn K+P vs K endgame

Of course the main plan for winning such a position is the creation of a passed pawn.  At the same time, you must strive to keep the opposing king out of the game as much as possible.
Now, the prime candidate for becoming a passed pawn is the e-pawn, since it is the only pawn that is not opposed by a pawn.  To achieve this you have to push the candidate to the front since it is the only pawn that cannot be blocked by the opposing pawns.  Unfortunately, in this case your king blocks that pawn, thus you have to move the king out of the way. 
It certainly requires some good calculation or a solid understanding of such situations to play Kf5, which parts with the f-pawn.  However, f6 is a clear candidate; afterwards you can easily move your king to f5 without dropping a pawn and continue to advance the e-pawn.  At the same time Black will have trouble to return into the game; all he can do is to advance along-side with the e-pawn (after Kf5 and taking the g-pawn Black takes even longer to return to the came).  Though it may not be easy to see that f6 is indeed winning, I think it rather easy to see that it is clearly one of the best tries.
After f5, however, it is not easy anymore to move your king away.  If you move to the d-file, White's king advances to f6, forcing the advance of your g-pawn and thus White's king returns back to the game with tempo.  On the other hand, moving to other squares drops the e-pawn, and thus certainly draws.  These options are clearly inferior, though again it may again not be obvious that it is enough for the Black king to actually take up some serious defensive tasks in the first line.

