It's a combination of several things. The very first perk I take on any character is Scrapper 1. I take rank 2 the moment it becomes available. I also take Scrounger (Luck 2 - more ammo), and use ammo as a secondary form of currency. .38 ammo is equivalent to a bottlecap and just as plentiful. My Initial SPECIAL was 8/1/5/5/5/1/3 (used the Perception Bobblehead in Concord to insure I could get Rifleman)
The character for this playthrough is a Strength based character who relies heavily on power armor. My primary suits have all had Calibrated Shocks in the legs (increased carrying capacity) and I have the Strong Back perk. I also have Local Leader 2 and Cap Collector 2. I also have a suit of clothes just for buying/selling (+2 Charisma clothes, +1 glasses, and +1 hat --- all are available right at the start in Sanctuary and are very light, just swap when about to buy/sell).
So, bear with me here, but what makes me have so much resources is not any one thing. It's a lot of little things that roll together. One little bit extra plus a little bit more extra plus a little bit more extra.
Every trip out into the Wasteland my character brings back more. Every time I'm about to fast travel back, I stop and pick up, literally, everything in arm's length (even if it overburdens me) due to Strong Back and then fast travel back and dump it into the Workbench. I make sure every town I set up has at least one vendor (usually a bar or general trader) in it. I make sure that its crops are either all tatos, all corn, or all mutfruit (so that I can make vegetable starch to make adhesives). Once I got Int 6 and Science 1, I built 5 water purifiers (industrial) in Sanctuary and then schlepped all the spare purified water it made each day down to the Drumlin diner -- hadn't gotten to DC yet -- and emptied Trudy's entire junk stock and deposited that into my workbench. Did the same thing to Penny Fitzgerald, Alexis Combes, and other general traders.
Once I had several towns connected via Provisioners, I had cows. Cows = Fertilizer and that = Jet. Jet is the most efficient to sell stuff in the game. Make some Graqe Mentats for yourself, then trade Jets and Water for your ammo, rare crafting materials, and Shipments of stuff you need like Copper, Steel, etc.
I, absolutely, have Chem Resistant, btw. As it was Very Hard, I also used combat Chems for handling difficult fights. That's a different story. You don't need to deal with chems at all if you prefer a 'Lawful Good' playthrough. You can stick to the 'Water Purifiers everywhere' thing for that (and it's in character for Lawful Good RP) and still make good(ish) caps. It's just heavy and takes more back and forth trips.
After that, it's just a matter of economy of scale. Enough vendors in enough towns and enough trips to the wasteland dropping enough junk into your workbenches and then selling enough spare Aid and Ammo items you don't need equals a metric TON of bottlecaps.