The structure of small intestine is suited for the purpose. The ileum has lots of villi. A large number of villi serves two purposes. It increases the surface area to ensure better absorption.
Moreover, it reduces the lumen size which ensures that the food stays for longer duration in the small intestine so that proper absorption can take place. Due to this, the absorption of digested food mainly occurs in the small intestine.