Pectin is primarily located in the middle lamella of plant cell walls, acting as a glue to hold adjacent cells together. It is also found in smaller amounts within the primary cell wall itself. Its abundance and composition can vary significantly between different plant species and even between different tissues within a plant.