Refinancing

If you refinance your house do you get money back how does that work?