Emergence and evolution of cooperation under resource pressure