Of course you are aware of a threat, there's someone standing in front of you casting a fireball spell. That seems like a threat to me.
It doesn't matter what they were doing BEFORE they became a threat. They are a threat now and you are aware of them.
Unless you mean that you have to be aware they are threatening towards you even before they do anything threatening. Doesn't that mean that both sides are always surprised?
"You see Orcs with Greataxes in the room. They turn around and attack you. You are surprised."
"No we aren't, we were aware of the threats!"
"Were you? There were a bunch of Orcs in the room. You don't KNOW they are going to attack you, they might have been friendly."
"But you just said they charged towards us and attacked."
"Sure, but before they had done that, you were unaware of any threat, so you were surprised. But then again, they were unaware that you were a threat either, so they are surprised as well."
The only way any of this makes sense is if Surprise only happens when you are unseen and unheard...i.e. Hidden. Which is what the sentence before that one in the PHB says, that you must be hidden to get surprise.
Here's a summary of the 4e stealth and surprise rules:
1. You can become Hidden by making a successful Stealth vs Passive Perception check. If you are unaware of your opponents you are surprised.
2. In order to Hide you must have full cover or concealment. To continuing hiding you must have at least partial cover or concealment. If you ever have no cover, you stop hiding immediately and everyone can see you.
3. If anyone is surprised, the first round of combat is a surprise round and anyone unaware of their opponents cannot act during it. Anyone who is not surprised can only take one action or a move during the surprise round but not both.
Sound familiar? They are identical other than 2 major changes: Surprise ends at the end of people's first action except the end of the round and the other people only getting to either take an action or a move. The only other thing that was changed was that the language was changed to be less "rules text" and more natural English. This means they changed the word "opponents" to "threat" to sound less like a game. But the meaning of it didn't change. If you are unaware of the people attacking you, you are surprised.
It should be noted that during the first "beta" release of the D&D Next rules that became 5e, the stealth/surprise section was literally copied and pasted from the 4e rulebook and each version after that had a couple of words modified one way or another.
It wasn't until quite a few versions that they eventually removed the idea of a Surprise Round from the rules and changed it to what we have now.
It should also be noted that nothing in the actual book says that Surprise ends at the end of your first Turn. It says if you are surprised you can't take Reactions until the end of your first Turn. The book never says that Surprise ends at the same time you can take Reactions again. The designers have clarified that Surprise ends at the same time, but that isn't actually written there.
There's a reason for that. Surprise ended at the end of the First Round until near the very end of the beta testing of the rules and was listed in a different section, which is why it vanished when that section was removed.
No, there's no in game rationale for why surprise ends during your first action. As I said above, it is a bug that is a side effect of removing the idea of "rounds" from the game.
So, what happens if someone is hidden, they are completely unseen and unheard?
My example from the marketplace: "I'm walking through the marketplace and looking at apples. A Rogue is hiding nearby. They made their Stealth check so I neither see nor hear them or any of their equipment. They roll lower than me in initiative. I take my first turn. I'm no longer surprised, but since I haven't seen nor heard them, I didn't stop being surprised because I saw a glint of metal or heard something and had time to react to it. I'm not not even aware that there's someone out there trying to kill me."
That's the definition of surprise according to the book, the person attacking has successfully hid from me and I'm unaware of a threat. The "bug" comes in because I really SHOULDN'T recover from being surprised just because I rolled higher in initiative, I'm still unaware of any enemies. But the bug slipped in there when they remove the surprise round late in the testing of 5e. It's small enough they aren't going to fix it.
Which is a large difference from "Someone in front of me pulls a hidden weapon and attacks". I'm perfectly aware someone is trying to kill me when my turn comes up in initiative. Which means I'm not surprised.