Natural selection really isn’t a series of steps. It’s a logical deduction, based on key points: 1) more individuals are produced than can survive (as you noted); 2) all orginsms vary, such that each individual will typically be distinct in some way from its brethren; 3) at least some of this variation is hereditary.
Now, assuming those facts to be true, then natural selection can be formulated as follows: if only some offspring can survive, then those which vary in such a way as to be better suited for the particular environment in which they find themselves will thus be more likely, on average, to survive. Those individuals will thus tend to leave more offspring, and the average composition of the population will then trend toward more individuals possessing those more favorable, hereditary traits.
It is key to understand that natural selection is a probability, not an inevitablity; the race is not always to the swiftest. The bestest and the stongest can still be squashed by a rockslide, and weaklings can still get lucky.
As for the OP, as has been noted, the key to survival is not always to outcompete other critters. Sometimes, simply finding a new food source that isn’t already heavily harvested can work to one’s advantage. This is the path taken by giraffes; rather than become more eficient at mowing grass or low browsing, they became better adapted at high-browsing – going after the tasty leaves higher up, the ones the rest of the herds couldn’t reach. Having a slightly longer neck was an advantage is such a situation (especially when the food lower down was sparse), and those who could, indeed, reach those tasty treats were the ones more likely to pass on their long-necked genes. Being long-necked comes with other advantages, too, such as being better able to spot predators.
Other animals may not have evolved long necks for a variety of reasons (though some others did, notably camels and sauropods). Some could have been more constrained in terms of the degree to which neck lengths could vary, some had put energy and efort into becoming more efficient at what they were already doing, others may have just moved on to a different location. The beauty of evolution is that it isn’t “one size fits all”; there can be multiple solutions for any given problem.
Note also that long, prehensile tongues evolved in giraffes as well, the better to get at acacia tree leaves while avoiding the thorny spikes that the trees had evolved to prevent those leaves from being eaten in the first place!