Thor got the hammer to control his powers and use it as a weapon. So when he lost it, he still had his powers(we all know that). Odin put a spell on Mjolnir: who so ever holds this hammer, if he be worthy, shall possess the powers of Thor(or something like that) So when Cap took the hammer, he was worthy and the hammer gave him Thor's powers. It's not really that complicated, Mjolnir's powers come from Thor and can be given to others.