And what are the advantages of creating subnetworks if computers are assigned different IP addresses from the same range and can communicate with each other also with switches?
The private address ranges specified by the IETF are typically broken down further into smaller ranges called subnets. A router/layer3 switch is required to route traffic (called packets) between the various subnets.
For example 10.0.0.0/8 is typically broken down to smaller networks such as 10.1.1.0/24, a subnet.
A private network is normally a network in one of the RFC 1918 private address ranges:
10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
A subnet, or network, is explained pretty well in this answer.
Hosts can communicate on the same network, or, with routers, across different networks. Networks are layer-3 concepts, and switches switch at layer-2. You should probably study the OSI Model, but remember that it is just a model, and the real world doesn't always work exactly how the model prescribes.
In most cases, a single network (or subnet if you prefer) is assigned to a a single LAN (or VLAN). This constitutes a layer-2 broadcast domain. That means that every broadcast is sent to, and interrupts, every host. It is also often difficult or impossible to put any controls, like security, QoS, etc. within a single LAN.
Breaking a LAN up into separate networks on separate LANs will ease the problem of broadcasts, and it allows you to install controls at layer-3. It also requires a router to be able to get from one network to another.