Tension and compression are not opposites
Two loading states with completely different failure modes.
Tension and compression are not simply opposite directions of the same kind of loading, because a member being pulled apart fails by the material itself tearing or yielding, while a member being pushed together can fail through an entirely different route that has nothing to do with the material's own strength, so a designer has to treat every member according to which of the two it carries.
A pull straightens, a push looks for a way out
A rod pulled in tension has every fibre inside it lined up and resisting the pull together, straightening the material along the line of the force, and the only way it can fail is for the material to run out of strength, stretching permanently or tearing apart. A rod pushed in compression is being squeezed, and any tiny curve or imperfection along its length gives the force something to push sideways against. Past a certain slenderness, a compressed rod stops failing by crushing and starts failing by the whole rod bowing sideways and folding, a separate failure called buckling, which can happen at a small fraction of the force needed to crush the same material in a short, stocky shape. Pulling a rod only ever tightens it along the line of the force, so tension failures are comparatively predictable, while compression failures depend heavily on a member's length and how straight it started out.
Dry spaghetti, pulled and pushed
Pull a strand of dry spaghetti by both ends and it goes taut and straight, resisting right up until it snaps cleanly. Push on the same strand from both ends and it bows outward partway through the push, then buckles suddenly sideways and snaps at the bow, long before the material comes near its own breaking strength. The same material handled both loads. Pushing gave the geometry a sideways escape route that pulling never offered, and that escape route decided how the strand failed.
Length controls that escape route strongly. A piece of spaghetti half as long carries about four times the push before it buckles, because the load a slender strut can carry falls with the square of its length, and a strut three times as long carries only a ninth as much.
Sizing struts and cables differently
A tension member can often be made thin and light, since a cable or a thin rod resists a pull along its own length as well as a much thicker one. A compression member carrying the same load usually needs to be thicker, or braced part way along its length, to guard against buckling well before crushing becomes a concern. Sizing a compression strut as if it only had to resist crushing is a common way for a structure that looks comfortably strong on paper to fail well below its calculated load. A strut whose load can reverse in service, pushing sometimes and pulling at others, has to be sized for the compression case, even though the same member would survive the tension case at a far smaller cross-section.
A short, stocky member, one whose length is not much greater than its thickness, does fail by crushing, since there is not enough length for a sideways bow to develop before the material gives out. A squat compression block, or a short bolt in compression, can reasonably be treated like a tension member, failing when the material runs out of strength instead of by buckling sideways. Deciding which regime a member sits in, stocky enough to crush or slender enough to buckle, is one of the first judgements a designer makes before any detailed calculation is worth doing.