Presumably both, to a large degree, since it's probably a pretty optimized aircraft. The engine & inlet are designed to compress the air using the shock patterns that develop at certain Mach numbers. Beyond that Mach range, it won't work. Likewise they probably didn't bother designing the airframe to work at speeds in which the engine couldn't.
The SR-71 is also high altitude, so if there is less air (pressure), that can change things like: how much lift you need or can generate, the outside temperature, how much air can be used by the engine, heating due to air friction, etc.