Like Part A and Social Security, their spending is determined by eligibility and payment rules and gets paid out of a trust fund (the Supplementary Medical Insurance or SMI trust fund).
FORBES: Medicare's Peculiar Budget Rules And The Fight Over Double Counting