The job of Prime Minister often means having to spend a lot of time with the Royal Family.
Even though the royals tend to firmly stay out of politics, their paths often cross with the PM.
Of course, the Queen holds a private weekly audience with the Prime Minister and it's not unusual to see them rubbing shoulders with other royals at high-profile events.