There are two types of companies through which you can buy online lottery tickets.
A lottery agent is a company that actually goes and purchase a ticket for you.
For instance, if you buy a MegaMillions ticket, the company will send an agent to a local retailer of MegaMillions in order to buy a ticket and fill out the numbers you selected.
In many cases, they will then scan the ticket and upload it to your account for you to see as proof.
The company will store the ticket until the results are publicized, and if you win, through various methods they will either get you the money or get you the ticket so you can redeem it.
On the other hand, there are companies which are not actual agents; rather, their function is to allow you to "bet" on the result.
For instance, if you "buy" a MegaMillions ticket through one of the best online lottery sites, they will not actually buy the ticket.
f you win, they will pay you from their own accounts.
These sorts of companies make more money off your purchase because they never actually buy the ticket themselves; but on the other hand, they pay very high insurance fees in case someone wins and they actually have to pay back a massive amount.
Such companies can offer bonuses, unlike lottery agents, but the risk tends to be higher.