万一 + [clause] + (,) + 怎么办?
[precaution],+ 万一 + [clause] + 呢
[subject] + 万一 + [verb phrase],+ [clause]
万一 is literally "one in ten thousand". It brings up something with a small chance of happening, usually something you'd rather didn't. The most common frame is a worried question with 怎么办.
After a precaution, 万一 + clause + 呢 gives the reason for it: "in case".
以防万一 is a set phrase for "just in case".
如果 is any "if". 万一 is only for an unlikely chance, so it doesn't fit an ordinary condition or a likely one.
It can still set up a condition with 就 or 的话 in the main clause, as long as the chance is slim.