The reason that Curley's wife flirts with Slim and Slim seems to flirt with her is somewhat complicated. She is not really promiscuous. She confides to Lennie that she has dreams of becoming a movie star. This explains why she spends so much time and effort on her appearance, including her Shirley Temple curls. It also explains why she seems to be so flirtatious. She is trying out her sex appeal on all the men at the ranch. But they want nothing to do with her because they are afraid of Curley. The only man who is nice to her is Slim. He is an intelligent, serious man and is not aroused by her teenage charms. But he is kind-hearted. He pretends to be attracted to her because he feels sorry for her. He feels sorry for her because she is married to Curley, because she is stuck on the ranch with nothing to do, and because he knows she will never realize her dreams of becoming a movie star. Slim is not afraid of Curley for at least two reasons. Slim is a skilled worker, the only man who can handle big teams of mules or horses. The boss couldn't fire him. The other reason is that Curley is afraid of Slim. At one point Slim tells him off:
"Well, you been askin' me too often. I'm gettin' God damn sick of it. If you can't look after your own God damn wife, what you expect me to do about it? You lay offa me."
"I'm jus' tryin' to tell you I didn't mean nothing," said Curley. "I jus' thought you might of saw her."
So Slim flirts with Curley's wife because he understands that she is only playing games, and he plays along with her. He is more like a father to her than a potential lover.