Queen Elizabeth II has been training Prince William to be king [1] practically all of his life, and given that she's his grandmother, it makes sense that there's a "special closeness" between them [2]. Not only does William often accompany Elizabeth [3] on some of her royal engagements, but he also steps in for her every now [4] and then. William has even described her as "the best role model I could have."
When William lost his mother, Princess Diana [5], in 1997, guess who was by his side, shielding him from the media [6]? The queen herself. Elizabeth "deliberately" removed newspapers [7] so that he and Prince Harry "didn't know what was going on." She may be the queen, but it's obvious that her family will always come first.
Links:
[1] https://www.popsugar.co.uk/celebrity/British-Royal-Family-Succession-44165327
[2] http://people.com/royals/how-prince-william-trained-to-be-king-as-a-teen-amid-the-queens-at-times-prickly-relationship-with-charles?xid=popsugar
[3] https://www.popsugar.co.uk/celebrity/Prince-William-Queen-Elizabeth-Buckingham-Palace-May-2017-43510505
[4] https://www.popsugar.co.uk/celebrity/Prince-William-Investiture-Ceremony-March-2018-44680894
[5] https://www.popsugar.co.uk/celebrity/When-Did-Princess-Diana-Die-43608712
[6] https://www.popsugar.com/celebrity/How-Royal-Family-Helped-Princes-After-Diana-Death-43941240
[7] https://www.popsugar.com/celebrity/How-Royal-Family-Helped-Princes-After-Diana-Death-43941240
[8] https://www.popsugar.co.uk/celebrity/Prince-Harry-Queen-Elizabeth-II-Pictures-44674463