Project Mercury was America's first space program in the 1960s, launching U.S. astronauts into short (~15-minute) orbital flights in an effort to keep up with the Russians, who had put Yuri Gagarin into orbit in 1961.
Ideally, the plan went, the Mercury capsules would re-enter the atmosphere over the Atlantic Ocean, where they'd be recovered by naval vessels. But what if something went wrong, planners thought--what if the capsule instead touched down over land, in the middle of a jungle or the desert? For that matter, what if the hatch became jammed shut during the touchdown, and the astronaut was trapped inside with no nearby help on the way?
NASA commissioned the knife from the Randall Knives Co., and it's made of steel, leather and micarta (a composite of fabric in a thermosetting plastic). According to the Smithsonian,
"This is a duplicate of a hand-wrought survival knife made by the Randall Knives Co., a maker of speciality knives of all types. One was carried as equipment on Alan Shepard's "Freedom 7" suborbital Mercury mission on May 5, 1961. On this flight, Shepard became the first American, and second human (after Yuri Gagarin), in space. The original survival knife was lost when the hatch was jettisoned after landing in the Atlantic Ocean."
"The Astro knife was strong enough to open the capsule hatch with force if needed (try that with a folding knife) and ready for survival situations. Cooper knew that astronauts could find themselves in inhospitable areas like desert, jungle and even oceans after a bad landing.
"… An important modification was made in the handle, where they created space to house small survival items like matches, fishhooks and line. A tiny screwdriver to unscrew the handle and gain access to the items inside was attached to the thong at the end of the knife handle. Also, a strip of space suit material was attached to fasten the knife to the Mercury survival kit or a pouch. These knives – like all knives in space – were not made to carry around. They were attached to especially designed survival kits which were somewhere inside the capsule."