To understand Classful vs Classless IP addresses, we first need to know what IP address classes are in the first place. IP address classes are as follows:
Class Range
A 0.0.0.0 to 127.255.255.255
B 128.0.0.0 to 191.255.255.255
C 192.0.0.0 to 223.255.255.255
D 224.0.0.0 to 239.255.255.255
E 240.0.0.0 to 247.255.255.255
An IP address is broken down into a network part and a host part. For example, the IP address 35.2.3.1 is classified as class A because the first octet of 35 falls in the range of class A addresses. Class A addresses generally have the first octet as the network part and the next three octets as the host part giving us a default network mask of 255.0.0.0 or /8
If this is the case the IP address is classful and originally all IP addresses were classful only. The shortage of IP addresses made way for classless addressing
Now consider the same IP address 35.2.3.1, which is a class A address and has the network mask 255.0.0.0 /8. Imagine moving the network portion which is the first octet to cover the first two octets (see diagram below)

The network mask would still be 255.0.0.0 or /8 but the subnet mask would be 255.255.0.0 or /16 and we would be divided the network into sub-networks. One advantage is conservation of IP address space. Instead of assigning the whole 35.0.0.0/8 address space to a client, we would assign the 35.2.0.0/16 address space or even better the 35.2.3.0/24 address space. The subnet mask would be determined by the required number of clients on the network.
Hence, we are freed from the limitation of using classful network boundaries like /8, /16, /24 as the demarkation for subnetworks, and can also have classless network boundaries like a subnet mask of /20 or 255.255.240.0 for example. Today, routers route both classful and classless protocols. Example of classful routing protocol is RIPv1. Classless routing protocols are EIGRP, OSPF, BGP are classless. Internally, since BGP comprises the backbone of the internet, the classful addresses are converted to classless and routed over the internet
So if everything is moving to classless addressing, where does classful addressing’s future lie. Well as far as the internet is concerned classless rules (however this discussion is not taking into consideration IPV6 where the limitation of IP addresses is not a problem)

This topic was one of those that I hated because I never understood it earlier