Can anyone give me an explanation about differences between SoftwareSerial library and HardwareSerial when is used each?
HardwareSerial is based on onchip UART, Software serial not. SoftwareSerial several disadvantages compared to HardwareSerial. SoftwareSerial is good to use if no or not enough serial ports are present.
Software serial tops out at about 57600 baud. You can't transmit and receive at the same time with software serial.