Cordless work well for the lighter work typical of DIY as a whole (before somebody points out that they drill mine shafts for fun and profit, you are not the average DIYer

), and I think many have been convinced that cords are obsolete and the box stores are happy to sell them batteries, so not going to do anything to dissuade them of that belief. There are still a lot of corded tools on the market, you just have to go online or shop the stores that still put all the stock on the shelf instead of just what is most profitable. If I go to HD you would think there are few cordless options, if I go across town to an independent hardware store they have a much larger selection of corded tools.
I lump air tools in with cords, because you trade power / endurance for being tethered. Air has the added issue of most air tools needing a fairly serious compressor. You can run small nail guns off of a pancake, probably the same for a ratchet, but framing at a decent speed with a large framing gun is going to take a bigger compressor and an air impact, die grinder or cutoff tool a lot more. This definitely makes cordless an attractive option. Even buying a completely new battery platform for a single tool is cheap compared to buying and installing a 10-20cfm 80 gal compressor. Air tools are relatively inexpensive if you already have the infrastructure, but you are probably well into the advanced DIY category if you do.
Cordless tools have come a long way, and are probably capable of doing 80-90% of the work of corded tools, so a home user that has opted for a full cordless shop isn't seriously lacking. Corded tools still offer a lot of benefits. First for someone on a budget they are always a cheaper option, and where the advantage of a battery is minimal you generally get a lot more tool for the money in exchange for the disadvantage of using extension cords. If you are in a fairly static work location as in a shop, cords are minimally intrusive. If you work outside, or on a ladder then cordless really come into their own.
Note I said larger drills. For a lot of work a 9.6v to 20v 3/8" drill is more than adequate. If you want to punch some holes in even thin steel plate or drill into masonry / concrete, cordless still can't touch what a corded drill can do. The other day I had to drill 16 3/8" holes into 1/8" steel plate to mount some castors. My corded 3/8" Milwaukee drill knocked out all 16 in about the same time I could have done 2 with my 18v cordless Makita, it was that significant of a difference. Drilling holes in wood, I'll always reach for the cordless unless I'm using a large hole saw because I can be done in about the time it took to get the extension cord to plug in the corded drill.
Of all the tools out there the 1/4" and 3/8" drill has probably seen the most enhancement from the invention of cordless technology largely due to the fact drilling holes by hand often benefits from freedom of movement. I mean what are the odds you will ever be using a circular saw over your head or while standing on a chair. The impact driver is basically a development of the cordless drill, not sure we would even have it as a common tool without the invention of the cordless drill.