Iirc phone contracts run til the end unless you give them 30 days notice. If you don't give them notice then yes it keeps rolling.
Much in the same way a tenancy agreement runs. Often initially for x amount of months then just keeps rolling.
I, fortunately, haven't had the pleasure of dealing with o2 and have been with T-Mobile/EE for 8ish years now and just renew my contract on the 22month mark and upgrade my phone then and have it run from then, but i think all phone companies are much-a-muchness when it comes to termination of contract.