A legal claim a contractor can file against a property when they haven't been paid for work or materials provided to that property.
A mechanic's lien attaches to the property itself, not the person who hired you. It makes the unpaid bill a cloud on the title — the owner can't easily sell or refinance until it's resolved.
Every state has its own rules: who can file, how soon a preliminary notice must go out (often within 20-60 days of starting), the deadline to file the lien (often 90 days after last work), and the deadline to enforce it in court (often 1 year).
Filing a lien is a powerful collection tool — often the lien alone gets you paid because the owner can't sell or refinance without releasing it. But miss a deadline by even a day and you typically lose lien rights forever.