I bet Hamlet wasn’t expecting to see the king here – since he didn’t know Ophelia had died – he’s not camped out here waiting for him.
But that raises the question of why Hamlet is in the graveyard. Are he and Horatio just out taking a stroll? That’s how I’ve always imagined it. They’re just out for a walk when they, by accident, stumble into a graveyard.
But what if that’s not it? What if they’re there on purpose? Like – to see what happened to Polonius’ body? Maybe to visit his grave to beg his pardon or ask his forgiveness? I’d like a Hamlet who turned up for that reason. I’m not sure it’s actually likely – but I like it.
One reason I know he’s NOT there is to have a psychological/philosophical discussion about death. That just happens to him when he turns up. I suppose he could have had a tip-off that the king is headed that way and he’s there to head him off – but he doesn’t know WHY Claudius is turning up there.