Many federal programs in the US are structured as entitlements. For example, if you've worked enough months and paid payroll taxes, you're entitled to Social Security payments and Medicare coverage. If you meet federal eligibility requirements for food stamps (which states are allowed to tweak a bit), you're entitled to payments.
But more often than you'd expect, benefits are allocated by dumb luck. And not just "this system is so complicated it's basically a crapshoot" dumb luck; "literally determined by a random lottery" dumb luck. One of the best examples, as a new video from the Urban Institute explains (see above), is federal housing assistance, which mostly comes from the Housing Choice Voucher program, better known as Section 8. About 19 million households are eligible for assistance from the Department of Housing and Urban Development, but only 24 percent or so (4.56 million) get it — and who gets to be in that 24 percent is largely determined by lottery. Add to that the half million households that get Department of Agriculture assistance, and you get a total of 5 million households getting help.
Of course, the problem isn't just that not enough households get help — it's that the market price of housing is too high to begin with. For more on that, see Matt Yglesias' great cardstack on housing affordability. And it's also worth keeping in mind that the biggest housing subsidies the federal government provides come not from HUD but from the tax code, and that they overwhelmingly benefit wealthy households. The mortgage interest deduction doesn't do a whole lot for you if you're in a household that doesn't make enough money to owe income tax, after all. Finally, it's worth remembering that there are cases when providing money to help low-income people get housing can actually pay for itself, namely as part of anti-homelessness initiatives that free up police and medical resources that would otherwise be used arresting, jailing, and hospitalizing people living on the streets.