Before get touching with MDT, you should know how does WDS works, because MDT must work together with WDS. See this article here: frankfu.click/microsoft/windows-2012/deploying-windows-services.html
The Microsoft Deployment Toolkit (MDT) is a “solution accelerator” used for designing and creating operating system and application deployment. It is typically used in concert with the Windows Automated Installation Kit (WAIK) to produce highly customized and automated deployment solutions.
Following image illustrate how do they work together: