POE 2's Gambling mechanic seldom awards amazing items, but will often help you get an upgrade to replace items that might be holding you back.
It's limited by two things - unique monster kills in the present Act, and your available gold.
You visit an NPC and they'll take gold from you and in exchange give you an item of the class of your choice. It will frequently be rare but more often magic.
Unique items can be awarded but are too rare for this to be useful.