White to play and win
White is a piece up but black is about to promote the e-pawn. So white needs to create counterplay with their passed d-pawn.
1.Kc8 e1=Q 2.d7 Qb4
Threatening Qb7# if white promotes to a queen. Most other moves queen moves can be answered with 3.d8=Q apart from 2...Qa5: 3.d8=N+ Kb6 4.Bc7+ and white wins the queen
White to play
3.d8=N+ Kb6 4.Bc7+ Ka6 5.Nc6!
Threatening to take the queen and if the queen leaves the b-file, white has Nb8 mate
5...Qb7+ 6.Kd7 Qa8
Forced as 7.Nb8+ would have won the queen otherwise
7.Nb8+ Kb7 8.a5! a6
Preventing 9.a6# 8...Qxb8 9.a6+ (9.Bxb8 {This also wins but 9.a6+ is easier} 9...Kxb8 10.f4!) 9...Ka8 10.Bxb8 Kxb8 11.f4!
White to play
9.f4
This puts black under some sort of Zugzwang since the e- and g-pawns can never move because white will promote one move sooner than black
9...Ka7 (9...Qa7 {This transposes to the game} 10.Nc6 Qa8 11.Bb8) 10.Nc6+ Kb7 11.Bb8 Qxb8 12.Nxb8 Kxb8 13.Kxe6
Black to play
The king and pawn ending wins easily because black cannot move any pawns and white will take the f- and g-pawns and promote their own f-pawn.