This isn't quite analogous. Developers use custom components because they encapsulate a common structure in Web apps not provided out of the box in vanilla HTML.
To use a more accurate analogy, they are akin to building an ALU with the use of a an adder (a fantasy component abstracting away the NAND gates) rather than completely in NAND gates.