A warrant is very similar to a call option (see "Comparison with call options" section here: https://en.wikipedia.org/wiki/Warrant_(finance)#Comparison_with_call_options)
So we can suppose we're dealing with a call option: If $P_t$ is the price of the underlying asset at time t and $K$ is the strike price, then the value of the call option is $V_t=\max(P_t-K,0)$ (if the option has not been exercised by time $t$). This value function indicates that if I own the call option, I will not exercise my right to buy the underlying asset at price $K$ unless the asset is worth more than $K$ at time $t$. By exercising my right at time $t$, I gain $P_t-K$, and the issuer of the option, by selling me an asset worth $P_t$ at a lower price $K$, loses exactly the amount I gain.
Your question seems to be getting at the issuer's intent: Why would you issue a warrant where you would have to pay money on average?
A warrant can be used to:
- Make bets, or
- Provide monetary compensation without giving up cash flow immediately.
1) As you've suggested, the bank may be hoping to never pay out a warrant. But if everyone else also believes that the value of the warrant is 0, then why would the warrant exist in the first place? Maybe the bank has information that others don't, so some people will buy the warrants from the bank, believing that the warrants have positive value less than the price they paid for them. This would be a use of warrants for betting, both for the bank and the people who purchase the warrants.
2) Companies that have promising future cash flow prospects but have poor short-term cash flow would often like to compensate their workers highly to attract talent, but cannot afford to do so immediately with money (e.g. tech startups). Stock warrants will go up in value with the company's value, so such non-cash compensation is often acceptable as a (partial) substitute for cash salary.