Rafael Nadal beat Daniil Medvedev in the Australian Open final despite trailing 2-0 after the first two sets, thus winning his 21st Grand Slam.