I'm new to DnD and I have to say that the combat is one of the things I'm having a hard time understanding. Like you said, how can you miss a hit when the enemy is in front of you? Or the game telling you that you have 25% of hitting the enemy that is standing in front of you? I used a super power spell and I was positive it could hurt the enemy and I get "Critical Miss". Seriously?
Because it's based on D&D rules. You have an armor class, which includes your reflexes (dex), your armor (+shield if you have one) and any magical enhancement. Then you have the advantage or disadvantage, which is 2 dice instead of 1, you keep the better result in case of the former and the worst result in case of the latter.
Then you roll a d20 (or 2 in case of advantage/disadvantage). You add all the bonuses you have from your weapon skills and must do equal or above the armor class number of your target.
A natural 1 is always a failure, even if you had 100% chance to hit. A natural 20 is always a critical success, even if you had 0% chance to hit.