This is essentially a problem in graph theory. Each person is a node and the infections from person to person form a graph. The extent of the graph at a given point in time is a function of the number of connections (on average) between persons and the contagion rate (R0), which for COVID-19 is estimated at about 2 to 2.5.
In the early stages of spread, everyone is non-immune and so the maximum rate is seen. As the contagion spreads, some people will have already been exposed, so they won't count - you can only count them once (this is assuming that people get immune).
Eventually, virtually everyone who's exposed has already been exposed and the virus cannot expand further. This is the "herd immunity" effect that Sweden was hoping for. They didn't get, it, incidentally. So you have a geometric expansion at first, with a damping effect and the disease becomes widespread. This can be represented with a relatively simple formula. It won't be strictly accurate day-to-day because the spread is a statistical process, but it will be fairly accurate overall, given the right data.
Machine Learning, on the other hand, depends only on what it has seen. As I said, it cannot look ahead except as conditioned by past experience. So to an untutored machine, the infection plot would increase infinitely and not damp or show herd immunity. And unless you're training for overall timelines (multiple plagues) instead of a specific plague's future trends, the later data from when damping kicks in will distort the earlier projections.