Avg hen lays about 250-270 eggs a year depending on breed. So 6 chickens (our coop is designed for 6) throws off about 1500 eggs a year. Avg American eats around 291 eggs + egg products per year (which is crazy!).
Most people build their coops or buy one from Tractor Supply or Amazon for $300 and day-old chicks are around $4 each and feed is inexpensive (50lb bag at Tractor Supply is $21). You can make the economics work super well if you want to but as most backyard chickens are treated as pets (I am leaving out large farms and homesteads, etc) a lot of people pamper and spend $ on their hens because it's more than just getting a lower cost egg if that makes sense.