When we say "A" is hit by "B", we mean "B" affects "A".
From Cambridge, one meaning of "hit" that is relevant to your context is
to have an unpleasant or negative effect on a person or thing
Look at these examples:
"Production has been badly hit by the strike." - This means that the strike created negative impacts on production. Due to the strike, factories were closed as workers were on the streets. This stopped production and there were losses.
"Demand for transatlantic flights has been hit by fears of terrorist attacks." - This means that because people were afraid of terrorist attacks, they did not want to travel by plane. The demand for tickets fell, and airline companies incurred severe losses. The demand for tickets was severely "hit" or "impacted" by fears of terrorist attacks.
In your case,
... one of [the] worst typhoons to hit [the] country in recent history.
means that there were several typhoons that happened before, but this one was the worst one. Because there was flood and severe damage to the country, the appropriate word is "hit". The country was badly affected by the typhoon. The impact of the typhoon was too severe.