These occur when two moving averages representing different trends criss-cross. These tend to be very slow. Fortunately all common stock chart programs, online and offline, do the difficult moving average calculations for you and plot price perfectly. Just as a ball bounces when it hits the floor or drops after being thrown to the ceiling, support and resistance define natural boundaries for rising and falling prices. Buyers and sellers are constantly in battle mode.
Support defines that level where buyers are strong enough to keep price from falling further.
Resistance defines that level where sellers are too strong to allow price to rise further. Support and resistance play different roles in uptrends and downtrends. In an uptrend, support is where a pullback from a rally should end. In a downtrend, resistance is where a pullback from a decline should end. Support and resistance are created because price has memory.