  Using observations from the MOSFIRE Deep Evolution Field (MOSDEF) survey, we
investigate the physical conditions of star-forming regions in $z\sim2.3$
galaxies, specifically the electron density and ionization state. From
measurements of the [O II]$\lambda\lambda$3726,3729 and [S
II]$\lambda\lambda$6716,6731 doublets, we find a median electron density of
$\sim250$ cm$^{-3}$ at $z\sim2.3$, an increase of an order of magnitude
compared to measurements of galaxies at $z\sim0$. While $z\sim2.3$ galaxies are
offset towards significantly higher O$_{32}$ values relative to local galaxies
at fixed stellar mass, we find that the high-redshift sample follows a similar
distribution to the low-metallicity tail of the local distribution in the
O$_{32}$ vs. R$_{23}$ and O3N2 diagrams. Based on these results, we propose
that $z\sim2.3$ star-forming galaxies have the same ionization parameter as
local galaxies at fixed metallicity. In combination with simple photoionization
models, the position of local and $z\sim2.3$ galaxies in excitation diagrams
suggests that there is no significant change in the hardness of the ionizing
spectrum at fixed metallicity from $z\sim0$ to $z\sim2.3$. We find that
$z\sim2.3$ galaxies show no offset compared to low-metallicity local galaxies
in emission line ratio diagrams involving only lines of hydrogen, oxygen, and
sulfur, but show a systematic offset in diagrams involving [N II]$\lambda$6584.
We conclude that the offset of $z\sim2.3$ galaxies from the local star-forming
sequence in the [N II] BPT diagram is primarily driven by elevated N/O at fixed
O/H compared to local galaxies. These results suggest that the local gas-phase
and stellar metallicity sets the ionization state of star-forming regions at
$z\sim0$ and $z\sim2$.
