Djokovic was far from at his best in 2012. In fact, it was one of his worst years since 2011. He only won one grand slam that year, lost to Murray a bunch of times uncharacteristically, including the defeats in 2012 US Open final and Olympic semi-final. Almost lost to Nadal in his best slam that is Australian Open and that was the only slam he won that year.
Roger Federer was at his peak in 2015. He couldn't have played better but still got outplayed and lost to Djokovic. in the Wimbledon final I mean, he produced arguably his best performance ever against Andy Murray in the semi-final, leading up to the final. His serve was on point and Murray, who is one of the best returners ever, couldn't do anything about Federer's serve. It was a masterclass performance in serving and in hitting winners. I can't remember Federer ever having a better performance against Murray, especially on grass. That was the ABSOLUTE pinnacle and peak of Federer, playing with a style that suited him best.
Yet, those same tactics were rendered useless and ineffective against Djokovic. His best attacks, his best shots, his best serves and all the things that were effective and successful against Murray, were futile against Djokovic. Meaning, peak Djokovic > peak Federer on grass. On top of the fact that Djokovic beat him not once, but in two back to back finals.
And on hard courts, the same is the case. Djokovic beat Federer in two back to back hard court grand slams, only a few months between them. Djokovic thoroughly outplayed Federer in the 2015 US Open final where Federer looked totally clueless as to what to do and then did the same a few months later in the 2016 Australian Open Semi.
The truth is, Djokovic has reached a new level that is beyond peak Federer, as much as it pains me to say.