If you bid on a domain and someone else wins it by placing a higher bid, you will get back the Pi you spent on your bid. Only the winning bid is paid. So, if your bid is not successful, your $Pi will be safe and will be returned.

You can view the auction rules via the Pi Browser for more details.