The pH in the small intestine (duodenum + ileum) has a pH of around 8.5. The pH is maintained by a slightly alkaline substance called sodium hydrogencarbonate.
The pH of the small intestine has to be maintained in order to provide an optimum pH for enzymes to function, the enzymes include such as protease, carbohydrase etc. Other than this, the sodium hydrogencarbonate can also help neutralize the hydrochloric acid from the stomach, so that the enzymes in the small intestine won't be denatured. If enzymes are denatured, their active sites are altered and cannot be used as biological reaction catalysts.
Additionally, these enzymes and sodium hydrogencarbonate are produced in the glands in the small intestine walls or the pancreas, specifically for enzymes.