I have a very rudimentary doubt. We know that a LAN has addresses in the same subnet. The LAN ends at the gateway router with that interface also belonging to the same subnet. But what exactly will break in the forwarding operation if we assign LAN addresses that belong to different subnets.
Having more than one subnet on a LAN used to be more common than it is today. You can configure the router interface with a secondary* address. This will allow the router to be the gateway for both subnets, and it will be able to route between them.
Depending on the type of router and software version, some features may not be available on the secondary interface. For example, Cisco routers would not establish OSPF or EIGRP neighbor relationships on secondary addresses.
*You can have more than just two subnets on a LAN. Cisco refers to them all as secondary addresses although they technically should be called tertiary, quartenary, etc.
The subnet is used to determine what hosts are "assumed to be on link". If a host wants to communicate with a host outside it's subnet then (assuming there is nothing special in the host's routing table) it will try and send the packet to it's default gateway.
If the default gateway knows about all the subnets and is prepared to send packets back out on the same interface they came in through then communication will work fine. Otherwise things are going to break.
When the default gateway notices that it is sending a packet back out the way it came in it may send ICMP redirect packets to inform the host that it can send the packet by a more direct route. The sending host may or may not take notice of said redirect.
The sending device will send an ARP request broadcast frame on to the network asking for the MAC address of the intended recipient based on the IP address of the destination. The holder of that IP address will respond to the sender advertising the MAC address. They will then be able to communicate with each other with out their traffic having to be routed through a Layer 3 device which is where things start to break down. As already mentioned.
This also has to do with how IP Routing works based on IP subnets.
Consider the following example
10.0.0.0/8 18.104.22.168/8 HostA ------------- Router ------------- HostB 10.0.0.1 LAN 1 LAN 2 22.214.171.124
When Host A wants to talk to Host B it sends the packet to the default gateway router asking it to direct it to the correct LAN.
The router is configured with a subnet on each of its link. It uses this configuration to build its routing table (these are called connected routes). The router looks up its routing table to find that it needs to use LAN 2 to reach any host in the 126.96.36.199/8 network.
The router then uses ARP to find the MAC for Host B in LAN 2. Once it figures out the MAC for Host B it rewrites the MAC header in the original packet to Host B's MAC and sends the packet out on LAN 2.
Now imagine if the Host B was assigned IP address belonging to a different subnet.
10.0.0.0/8 188.8.131.52/8 HostA ------------- Router ------------- HostB 10.0.0.1 LAN 1 LAN 2 184.108.40.206
If Host A sends a packet to Host C, the Router will drop the packet since it will not know the LAN to reach 30 network.
This answer is a bit simplified by assuming that Host B does not send any ARP.