Cargo Racks can be found in ship wreckage points of interest on the surface of planets and moons. When they are destroyed by weapons fire from a ship or SRV they break apart and release Materials, which can be collected using a ship's or an SRV's Cargo Scoop.
The canisters they contain are not as large as normal Cargo Canisters and have a different appearance. They contain materials, not normal cargo, so this type of cargo rack appears to be where ships store materials. Destroying Cargo Racks will always yield 1-2 different materials, and each sample yields 3 units of that material.
In the Elite Dangerous: Horizons Planetary Landings beta Cargo Racks did drop materials when destroyed, but from release version 2.0 until version 2.0.02 they didn't drop anything when destroyed.
A close-up view of the rack reveals the small cargo canisters which contain the materials.