Does the word "pay" have the same definition in the next two sentences?

She had to pay the penalty for speaking out rashly.

You'll pay for this!
the same meaning