Hail Mary (n. or adj.)

What does the idiom “hail Mary” mean?

Definition: A desperate, last-ditch attempt

Example: The ruling party is going to make one more hail Mary attempt to pass a tax increase, even though it’s failed twice.

Note: This expression comes from American football and is North American. It is now used in contexts outside sports.