There are many devices which only cater to headphone or speakers, and not both of them at the same time. It also means that you must know the basics of the devices.
That will help in playing sound through speakers and headphones simultaneously. First thing first, you should understand the need for multiple ports or outputs in the devices.