Since Britain was in a greater bargaining position than China at that time, wouldn't it make sense for them to keep Hong Kong permanently instead of leasing it for 99 years? Why did they do this? Thanks!
That conflates two events:
First Hong Kong Island and most of modern Kowloon were ceded to the UK in perpetuity following the Treaty of Nanjing in 1842; so it was indeed annexed outright. The UK was in a position to make such a demand because of the complete defeat of Qing during the First Opium War.
So southern Hong Kong was (or was meant to be) permanent British territory- a Crown Colony in the same manner of Gibraltar or the Falkland Islands from that point onwards. It was not leased.
That may or may not be what you meant by colonisation: in the sense of being a permanent overseas terrirory, it was, but not really in the sense of being a destination of large scale civilian settlement- there absolutely were British settlers in Hong Kong, but not in nearly sufficient numbers to largely replace (or, worse, eradicate) the indigenous population. That was typically practiced in more temperate regions- see, e.g. New Zealand in the same period.
Second is the acquisition of the New Territories following the Convention for the Extension of Hong Kong territory in 1898. The clue is in the name- Hong Kong Island became (and remains) overcrowded and in desperate need of farmland and housing space for its population, and acquired the New Territories to achieve this. This is a role it still plays today, to an extent.
This treaty arose from significant power disparity, sure, but not from a recent destructive war, so the UK's negotiating position was not quite so strong in 1898 as 1942 1842; though that's arguably not saying much. This partially explains why a lease was agreed upon rather than further annexation.
Another potential explanation is that in the UK, landownership in the form of 99 or 999 year leases is extremely common. See, for example, the near contemporary Law of Property Act 1925 which remains in force today. Illustratively, although I "own" my London flat, on paper, I "lease" it (for free, for 199 years) from the descendants of a petty aristocrat who owned the farmland in 1800-something when it was originally built on. The New Territories were simply a large example of the same thing.
Lastly, this was not atypical of the colonisation (if this is the correct term) of China generally. Outright territory grabs were not typical or particularly rewarding relative to commercial concessions- the right to trade without tax in a port; the ownership of a railway across Qing ruled land; exemptions from certain criminal courts or internal tarriffs; the unilateral right to operate a banking system in a given city. This was fairly typical of the colonisation of areas with a reasonably developed economy; the position in Latin America or (originally) Egypt was very similar.
As to why all of Hong Kong was returned in 1997 at the end of the New Territories lease- it was simply appreciated that Hong Kong proper was not economically viable without the New Territories. Most large cities would not be if they found their commuter suburbs suddenly across an international border.
Quite how well that worked out is another matter; it always struck me that Hong Kong began from an outrageous act of exploitation by the British and looks likely to end as a result of an outrageous act of exploitation by China- I really have very little sympathy for either side; except the Hong Kongese.
Edit: typos
More can of course be said, but I covered the specific context of the New Territories lease in this earlier answer.