Chains are the most complex part of the bike with the most moving parts. You have to lubricate them, they stretch.. But they work well in all variety of conditions (even rusty and squeaky) and are fairly cheap.
Sheldon Brown's (RIP) bike pages have some good articles on the good old chain.
old school html ahead: https://www.sheldonbrown.com/chains.html