NPT and NPS share the same thread form, with the same 60° angle, same pitch, and same dimensions along the flanks. They look identical, they'll thread together without any resistance, and the only difference is whether the thread tapers.
NPT: The Tapered Standard
NPT stands for National Pipe Tapered. The thread diameter increases as you travel along the fitting, so as you tighten a male fitting into a female fitting the threads progressively wedge together and that wedging action is what creates a pressure-tight joint. You still need PTFE tape or thread sealant as the threads don't seal on their own, but the taper is doing the mechanical work.
NPT is the thread type you'll find on the vast majority of pipe fittings: elbows, tees, couplers, nipples, ball valves, and anywhere the threaded joint itself needs to hold pressure.
NPS: The Straight Standard
NPS stands for National Pipe Straight. The thread diameter stays constant from one end to the other, and because there's no wedging action two NPS threads mated together cannot form a pressure-tight seal on the threads alone.
That sounds like a limitation, but it's actually the point. NPS is used in applications where you want a mechanical connection without depending on the threads to seal, the most common being lock nuts. A lock nut threaded onto a bulkhead fitting clamps it against a vessel wall and the seal comes from a rubber or silicone gasket compressed between the fitting flange and the vessel, not from the threads.
Can They Be Combined?
Since NPT and NPS share the same pitch they'll thread together freely. In the specific case of an NPS lock nut on an NPT-threaded bulkhead fitting that combination is standard and works well as the lock nut doesn't need to seal, just hold. If you tried to connect two pipe fittings thread-to-thread using NPT on one side and NPS on the other and expected a seal at the joint, you'd be disappointed. Use NPT throughout wherever the joint itself is the seal.