A review of the formation of large scale structure through gravitational growth of primordial perturbations is given. This is followed by a discussion of how symmetry breaking phase transitions in the early universe might have produced the required perturbations, in particular through the formation and evolution of a network of cosmic strings. Finally, the statistical mechanics of string networks, for both cosmic and fundamental strings is discussed, leading to some more speculative ideas on the possible role of fundamental strings (superstrings or heterotic strings) in the very early universe.