  We consider the focusing (attractive) nonlinear Schr\"odinger (NLS) equation
with an external, symmetric potential which vanishes at infinity and supports a
linear bound state. We prove that the symmetric, nonlinear ground states must
undergo a symmetry breaking bifurcation if the potential has a non-degenerate
local maxima at zero. Under a generic assumption we show that the bifurcation
is either subcritical or supercritical pitchfork. In the particular case of
double-well potentials with large separation, the power of nonlinearity
determines the subcritical or supercritical character of the bifurcation. The
results are obtained from a careful analysis of the spectral properties of the
ground states at both small and large values for the corresponding eigenvalue
parameter. We employ a novel technique combining concentration--compactness and
spectral properties of linearized Schr\"odinger type operators to show that the
symmetric ground states can either be uniquely continued for the entire
interval of the eigenvalue parameter or they undergo a symmetry--breaking
pitchfork bifurcation due to the second eigenvalue of the linearized operator
crossing zero. In addition we prove the appropriate scaling for the stationary
states in the limit of large values of the eigenvalue parameter. The scaling
and our novel technique imply that all ground states at large eigenvalues must
be localized near a critical point of the potential and bifurcate from the
soliton of the focusing NLS equation without potential localized at the same
point. The theoretical results are illustrated numerically for a double-well
potential obtained after the splitting of a single-well potential. We compare
the cases before and after the splitting, and numerically investigate
bifurcation and stability properties of the ground states which are beyond the
reach of our theoretical tools.
