All sin comes from the genetic traits in our DNA that gives power to deceive our thoughts. Our thoughts come from our created image in God, who is nothing but thoughts. Our brains are only processors of our thoughts and where our memory is stored.
Memory is a contributor to the sin process. When a young man discovers a new sin that gives him pleasure, it is locked in his memory. Each time that memory is triggered somehow, his desire takes over and causes him to act on his sin.
The only way to stop this power of sin is to change the genetic traits. This is what God had to do in his chosen ones like Jesus and us saints to make us sinless. Sinlessness is required to receive the knowledge of God, which is the truth.