That's hardly a spoiler, it's a system that the game explains when it introduces smithing.
One way to get a +1/2/3 equipment is to get lucky while making it. Critical hits while crafting have a chance of making the bar stop at the arrows, like demonkaze mentioned.
There's another way - it's the last option in the crafting menu, called うちなおし (reforge). When you make an item and don't fail (black smoke, しっぱい
you get orbs (うちなおしの宝珠
which you can use for reforging. Even when you fail reforging, you don't lose the current upgrades, so try away. Later in the game (at the
) you can also buy the orbs for 100 gold per orb.