It's sort of difficult to explain but I'll try my best.
Someone at eBay thought it was more important to make a few pennies by pushing 3rd party ads to it's users then to ensure their users have a pleasant safe experience using eBay. The problem occurring is those 3rd parties often miss hackers attempting to push malware or worse to machines using the ads.
eBay could simply remove the code and this would stop for everyone but they have never really responded as to why it's there.
I suggest downloading adblock on any browser you use eBay with. That stops the popups for me. Don't click the links cause they are going to probably be bad news for your device.