a refinery sends out little ships (they look just like trade ships) that visit resource rocks in the grav well and all the adjacent (1 phase lane) grav wells to the refinery. each resource rock can support up to 3 refineries sending ships to it.
the refinery itself then generates a small amount of resource income for each resource rock being visited by one of its ships. its a modest amount, maybe .1 resource/sec worth of income for each rock. you'll have to double check the exact number on that, it might be more.
considering how expensive refineries are it tends to only be worth building them at select locations that have alot of rocks in range. i usually find that if you can get 8 or more rocks in range of a location its worth building refineries at that grav well. else, you probably get more benefit from a trade port instead.