Monkey D. Luffy gained his powers by eating a Devil Fruit known in the story as the Gum-Gum Fruit (Gomu Gomu no Mi) when he was a young boy. This mystical fruit gave his body the properties of rubber, allowing him to stretch his limbs and granting him unique combat abilities such as stretching, inflating his muscles, and enhanced physical strength
. However, it was later revealed that the fruit's true identity is the Mythical Zoan-type Devil Fruit called the Hito Hito no Mi, Model: Nika. This fruit allows Luffy not only to have rubber-like properties but also to transform into the Sun God Nika, granting him extraordinary powers including the ability to bend reality and alter his body and surroundings according to his imagination. This awakening of his Devil Fruit powers enabled him to reach his peak form known as Gear 5, which significantly boosts his strength and grants him cartoon-like freedom of movement
. In summary, Luffy's powers originated from eating the Devil Fruit that was initially thought to be the Gum-Gum Fruit but is actually the Hito Hito no Mi, Model: Nika. This fruit gives him rubber-like abilities and the power to awaken into a form with immense strength and creative freedom in battle