Driving a screw directly into wood forces the grain of the wood apart. Soft wood will crush a lot and allow the screw to force its way through. Hard wood is much more likely to simply split when the screw forces its way between the wood fibres. Either hard or soft wood will split when you screw near to the end or the side of a board, as you can see in the first photo.
A proper pilot hole will have three separate cuts: the smallest drill provides for the shaft of the screw to go into the wood without pushing sidewise but the threads will bite into the wood. This hole is drilled into the second piece of wood.
The larger drill goes all the way through the first piece of wood and is designed to allow the screw to turn freely without the threads biting. This will allow the screw to pull the two pieces of wood together.
The third drill creates a bevel shape for the head of the screw to sink down flush to the top of the wood, or even deeper to permit putting a wooden plug over the screw head.
If you hold your screw behind the drill bit shaft and you can see the threads on both sides, but not the screw shaft, you have the right size for the pilot, or smallest drill. If the smooth part of the screw shank is long enough to pass completely through the first piece of wood with no threads biting into the wood, you don't need the clearance hole, because the screw will turn free as the screw snugs down. However, if the threads will still be in that first piece of wood when the screw is snugged down, then you must choose a drill bit that will let the screw in freely, threads and all.
You can purchase a 4-in-1 adjustable drill for doing all of this in one stroke. They come in sizes to match the screw sizes, such as #6, #8, #10. The length is adjusted by loosening the screw and each of the drill sections can be adjusted for board thickness and screw length. The collar can be set as in the photo for a flush screw, or set back to cut the holes for screw plugs. Non adjustable pilot drills like this can also be purchased for the common individual screw sizes and lengths.