Website XSSed your router(forgot to customise your router admin password).
Rogue devices on your LAN performed an ARP hijack and modified HTTP traffic to inject ads.
Your ISP hijacked your traffic to inject ads or your ISP themselves got hacked.
The website got hijacked.
Those are the 4 possibilities.