Hi,
The subnet is a three-layer concept, which refers to the division of IP addresses by borrowing host bits to use as network bits, also known as variable-length subnet masks. After an IP address is divided into subnets, the subnets actually belong to different networks, and the communication between them needs the support of Layer 3 devices.
And VLAN is a layer 2 concept. It divides a large broadcast domain into more small broadcast domains. A VLAN is a broadcast domain. Since the communication between computers is actually realized by MAC address, so if a computer in one VLAN wants to communicate with a computer in another VLAN, it will broadcast ARP packets and ask for the "MAC address of the destination host". But at this time, the broadcasted ARP packets cannot reach another VLAN, because a VLAN is a broadcast domain, broadcast packets can't reach another broadcast domain, so the communication between different VLANs also need Layer 3 devices to achieve.