Consider an employee enrolled in an HDHP with an HSA, and an employer that makes pre-tax contributions. In addition, in later years, while still enrolled in an HDHP, the employee makes personal, post-tax contributions, and takes a deduction on his personal tax return.
Years later, while no longer enrolled in an HDHP but still owning the HSA, the employee makes post-tax contributions to the HSA but does not take a tax deduction for the contributions. Say the employee continues to make these HSA contributions, while not enrolled in an HDHP, until they reach age 65.
At age 65, they choose to take distributions from the HSA for medical or non-medical spending. At that time, how does the IRS know that contributions were made to the HSA in the past while not being enrolled in an HDHP?