Medicare is a federal program based primarily on age, while Medicaid is a state and federal program based on income and certain conditions.