It’s pretty simple: The cost to make the structure of a house is pretty much the same for luxury or basic models: Framing, electrical, foundation, etc.
But if you throw in some cheap granite countertops, a fancy tub, and up-market flooring suddenly it’s a luxury house and you can charge twice as much, despite it not costing nearly twice as much to build.
Same thing goes for cars: A luxury car just has different fabric and some badges, but they charge way more than a comparable econobox because it’s “luxury.”