The difference between a 2.1 channel soundbar and a 5.1 soundbar is the number of speakers. A 2.1 channel soundbar has two speakers and a subwoofer while the 5.1 channel soundbar has five speakers and a subwoofer.
The general rule of thumb for knowing the speaker configuration in a soundbar is by decoding the channel number. The first number of the channel indicates the number of speakers while the later represents whether it has a dedicated subwoofer or not.