In very generic terms, feedback occurs when the sounds comming out of your amp set up a sympathetic vibration with the strings of your guitar. The creates a loop and in effect builds and builds. There are many things which effect feedback. Volume of the amp, Positioning, direction of the pickups relative to the amp, tone settings. There are others, but that's a good start.