They usually get configured together, one-to-one, on the same set of ports — which is exactly why so many engineers learn to treat them as the same thing. They aren't.
Ask someone to define a VLAN and a common answer is "it's a subnet, but for switches." That mental shortcut works often enough in practice — most access-layer designs assign exactly one subnet to exactly one VLAN — that it goes unquestioned until a design breaks it: a router with two IP subnets riding one VLAN, or a Layer 3 switch routing between VLANs without ever touching a physical wire. VLAN and subnet answer two completely different questions, at two different layers of the stack, and the 1:1 mapping between them is a convention teams adopt for sane troubleshooting — not a rule the protocols enforce.