Most of the time the number of real roots must be odd. To see why, imagine the graph. We can assume the coefficient of the leading term is positive. Then as $x$ grows, the graph is eventually above the $x$ axis and stays there. When $x$ is way off to the left the graph is below the axis.
Since it starts below and ends above it must cross an odd number of times.
That's most of the time. But the graph might be tangent to the $x$ axis, as in the comment from @HansEngler. To get the count right you have to count that kind of root with its proper multiplicity. That will be even if the root is a local maximum or minumum and odd if the root is an inflection point.