It comes from the old English word dubbian (to strike with a sword), used when a king or knight tapped someone on the shoulders to grant them knighthood.

The phrase means "I formally name or appoint you."

No pen, no crown, no courtroom floor— Just two words that open a door. "I dub you" speaks what wasn't true: A friend, a knight, a version new. The sword can tap, the king can bow, But meaning waits for "I dub you now."