Until the 1980s you wouldn't need to ask the question. For over a century cross country skiers had raced using diagonal stride, a bit like walking or running on snow. Trails were narrow with limited preparation. The first skiers would set the track and others would follow in their wake.
American Bill Koch didn't invent cross country skate skiing but brought it to an international audience. Given that ice and roller skating used this technique it is amazing this style didn't catch on sooner. Maybe a testament to conservatism in the sport which was traditionally run on narrow trails with little preparation. Koch first saw skating technique in Swedish races and applied it to world cup events. Within 5 years the sport was revolutionized. Nordic combined (ski jumping and cross country) and Biathlon, a mix of skiing and shooting, now exclusively use the skate style.
Bill Koch, out of the tracks
In fact skate style has been in use since the 1930s and particularly from the 60s in ski orienteering events which would often use wider tracks and roads. When it transitioned to cross country, skaters would put one ski in the classic track and push with the other ski, this is called marathon technique. Skating is around 15% faster than classic style and Koch, not the fastest classic skier in the world, was able to use this advantage to win overall in the 1982 Cross Country Skiing world cup. Incidentally Koch was the only American nordic medal winner until Randall and Diggins took Gold in the 2018 Women's sprint relay.
The "marathon skate" technique was soon abandoned for both skis out of the tracks in a V shape, the start of what is now known as Skate One (Brit.) or V1 technique. Races continued to be mixed with much controversy until 1985 when the sport was split into two disciplines: skating and classic.
Classic technique has evolved as grooming and equipment has improved. At competition level double polling is dominant. This technique relies on very good upper body strength, keeping the skis parallel and using the shoulders to push the skier along the trail. Skiers may get rid of grip wax altogether to gain an extra advantage when gliding. Races now introduce sections where double polling is not allowed or add steep hills where it is inefficient but even on steep slopes the elegant diagonal stride had given way to a kind of frenetic running stride. Recreational skiers largely use diagonal stride, similar to walking on skis and herring bone for going up steeper hills. Sometimes an intermediate technique: kick double pole is used.
Classic skis tend to be relatively long, the length depending on the flex of the ski and the weight of the skier. There is a zone under the foot of the skier that can grip the snow for traction, either using a special wax, scales moulded into the base of the ski or a skin. When standing on both skis this zone is above the snow but when the skier puts his weight on one ski the zone comes in contact with the snow surface and the skier can push forward. The ability to engage this grip zone (called the wax pocket) and glide on a single ski differentiates recreational from good classic skiers.
Skate skiing has come along way since the mid 80s. Techniques to deal efficiently with different types of terrain have developed and been refined. Nowadays three main techniques are used by elite skiers: Skate 1 (V1) an asymmetric technique for climbing steep hills, Skate 2 (V2), where there is a pole plant for each skate, for cruising on flats and Skate 3 (V2 Alternative) for fast skiing and downhills. Skiers may also use herringbone for very steep gradients and freeskate (no poles) for downhills and flats. Occasionally double polling is used for passing narrow sections of the trail or overtaking skiers.
Equipment has diverged from classic skiing. Skis are shorter, there is no need to engage a grip zone as the edges of the ski are used to grip the snow so skis are shorter and more like a spring - storing and returning energy with each step. Poles are longer and boots have more angle support and the ankle doesn't need to flex as far.
The first question is maybe why you have to choose. Many skiers combine the two styles. Choosing classic technique when the conditions are not great for skating: fresh snow, warm weather, ungroomed trails. However this requires an investment in two sets of skis, poles and boots. Skate technique is more physically demanding so for skiers who are only going for a few days a year classic maybe makes more sense.
There is a misconception that classic style is the easier, less sporty cousin of skating. Great for old ladies out for a chinwag on the trails. In fact classic is far harder to master. Expert skiers generally start when they are kids to develop the balance skills and muscle memory necessary. However it is true that the technique can also be practised as a kind of shuffle allowing unskilled and relatively unfit skiers to move around on the snow: either on marked trails or more nordic terrain.
Skate skiing is also an adaptation of classic technique. For example V2 is really double polling applied to skating. Learn classic well and the techniques: hip position, weight transfer, balance will help when skating. The key thing is to be able to apply the different strides correctly. Years spent pounding the tracks with incorrect technique will take time to fix, even with lessons.