An infected computer can respond slowly, behave erratic or have popups. If your computer is behaving out of the ordinary and has any of these symptoms, it may be infected.
Regarding why you have a virus:
This can happen for a variety of reasons. If an antivirus is not kept up-to-date it will not detect newer viruses. One antivirus will not protect you against every known virus. Viruses are made every day and sometimes antiviruses don’t have a chance to detect them, such a zero day virus. The best prevention against malware is you, the user. Be wary of where you connect to, and what you download/click on your computer