How much ram do you got ? The sudden lags occurs usually because of insufficient ram.
While other background programs were running and using memory, and when something new happened in the game which requires memory, the ram needs more space, and when it's full, the pc removes the oldest datas in the ram, and adds the new ones, while adding the new datas, it adds the game data and the background program data at the same time, so it makes lag depending on your processor speed.
If the ram is considered high enough, then your anti-virus software is making an auto update by automaticly searching and downloading new database. This happens mostly on Avira or Avast antivirus.
If you don't have an anti-virus software, that means your pc has a trojan which eats all the CPU process. If you want to be sure about which program is making the pc laggy, open the task manager, go to "performance", and click on CPU, it will filter the processes from the ones which use the CPU the most, to th eones which use it the least. So if you detect a system-look-alike process (for example, scvhost.exe) using %90 CPU, it means you have a trojan which may also send even all your key info to anybody else (aka keylogging).