The underlying theme in Ex Machina is the Turing test and the ethical implications of creating intelligent machines. The movie revolves around a young programmer who is invited to administer the Turing test on an advanced humanoid AI, and it explores the complexities of human-machine interactions and the blurred lines between artificial and human consciousness.