At least when I was working as a Patent Examiner, any prior art would cause a rejection of the claim. The purpose of the annual fees was to keep your patent active, which ONLY meant that you had “protection” (a government-protected monoply) on the idea. If you let it expire, it doesn’t mean that someone else can patent the idea, but it does mean that someone else can manufacture it without paying a royalty.
A patent can, and almost always does, describe an improvement on prior art. Hang a new doodad on an old thingamabob, and you can patent it. The old thingamabob is still what it was, but if your improvement is novel and can be made and used by someone with ordinary skill in the art, then you are eligible to pay issuance and maintenance fees on your paten