"Whosoever holds this hammer, if he be worthy, shall possess the
power of Thor."
Mjölnir isn't solely Thor's hammer. If the hammer deems someone
'worthy', they can use it just as Thor can. Therefore, Cap is
worthy. Simple as that, as far as I've understood it.
We already saw him move Mjölnir a bit in Age of Ultron when the
team was taking turns trying to lift it so this didn't really come
out of nowhere. I heard someone thought that maybe Cap would've
been able to lift it already in Ultron but he was being nice to
Thor by pretending he couldn't. I like that theory. :b