It implies that
when someone is hungry or desperate, they are driven by their basic needs and are not bound by a specific location or constraints The phrase often serves as a metaphor for human behavior, suggesting that when people are in a state of deprivation or urgency, they become more adaptable, resourceful, and willing to go to great lengths to fulfill their needs.