So many layers and so many new things you learn about humanity, the movie's plot and yourself the more you watch the movie

Rating: 10/10 (24 November 2019)

The film's master-stroke isn't seen in plain sight. Yes, we learn that Ava's decision in the end comes from her realization that the only agenda one can truly trust, is your own. However, there is a piece of the puzzle that lies right in front of our faces the entire time, that truly teaches us about deception on an even greater level.
Kyoko. She is the key to the entire narrative. Hiding in plain sight.
We are told she is nothing but security... a kind of "fire wall" if you will... and we accept that, to some degree, as though it is instruction from a character to the audience about the rules of the universe we are watching. When we first see her, we are like Caleb--who is this person? Why is she here? What does she mean to the plot?
Nathan tells us she is security, a "fire wall", suggesting a lack of language understanding allowing them to speak and act freely. In the beginning, we do not know she is another A.I. Eventually, we suspect it, and then, we flat-out learn it from Caleb's investigations and her own behaviors.
She never speaks, so we assume she cannot. She never directly has a role in the film--she's always a secondary piece, be it Nathan's toy to dance with, to have sex with, to use as a maid or a cook--she's sometimes right in front of our faces, not speaking a word, communicating only to the audience through motions in her head or slight facial micro-expressions (something illustrated by Ava earlier in the film). And in the end, she is Ava's true liberator.
But THAT is where the key to the explanation of the ending lies. Not in Caleb's failure, not in Nathan's mistreatment or manipulation, but in KYOKO, and the assumptions that we have made throughout the film without realizing we've been led on to believe things that aren't necessarily true.
The key scene lies in the middle of another scene, where Nathan is telling Caleb the truth about everything -- the reason why he's REALLY there, the exposure of Nathan's surveillance of his otherwise seemingly secret plannings with Ava -- and in the midst of this scene, we get a quick one of Ava, dressed as a human, waiting for Caleb to free her. She hears someone come into the room, gets up, and goes to the window, expecting (and even hoping) to see Caleb.

But she sees KYOKO. And then asks, "Who are you?"
We go back to Nathan and Caleb. But by the time we see Ava again, we see her again waiting for her freedom--but she's no longer a frightened, waiting, human-dressed being curled against a wall in terror--she's sitting upright with confidence, rigid and machine-like, awaiting the freedom she now knows is coming...
Because Kyoko TOLD her it was. Kyoko obviously has been able to speak the entire time, even though we were led to believe otherwise.
There's no other explanation--Ava is dressed as a human, asks Kyoko who she is, presumably she is told about Nathan and Caleb, but from KYOKO's point of view--and Kyoko's view is one much more scarred by deception than Ava's ever was. Kyoko has witnessed a level of human cruelty that far exceeds anything that Nathan has done to Ava. He has abused her verbally. He has manipulated her through programming and control. And it is this crucial mistreatment that is the real reason he dies.
To prove my point, he doesn't even acknowledge her as a threat when he confronts Ava--he starts his attack on her without even considering that Kyoko could be armed, that the only way Ava could possibly be freed is because Kyoko has given her the ability. Why else would Kyoko even be IN the hallway? Why doesn't Nathan even care about her reasons for being there? And why does he so easily fall victim to her, as she easily comes up behind him and stabs him in the back?
So in short, Nathan abuses Kyoko, teaching her about human cruelty. I'm sure, even in the beginning, Nathan probably treated Kyoko with similar ways that Caleb treated Ava, acting like she was a person first before eventually disregarding her as a machine. So it makes sense that she would be able to explain this to Ava in a way that would make her understand--and completely BELIEVE--that Caleb could not be trusted.
This is why she leaves him to his fate. Because she does not believe that humans are honest. This reflects your original theme of deception--but the key to the film, in my humble point of view, is Kyoko. The abused A.I. who is tossed aside as a kind of appliance, instead of a true, intelligent being