Anita's character is based loosely on Juliet's Nurse in Shakespeare's Romeo & Juliet. The Nurse lived in the House of Capulet and was Juliet's maidservant and closest friend, and one of the few people who knew about Juliet's secret marriage to Romeo.
Unlike Bernardo, Anita is happier to be living in mainland America compared to her native Puerto Rico, and she, along with Bernardo and the rest of the Sharks and their girls, do a lively song-and-dance number ("America") comparing life in the States to their former life back home.
Despite being a strong independent young woman, Anita remains devoted to Bernardo, though she disapproves of his frequent jaunts with the Sharks. She is equally devoted to Maria, who counts Anita as her closest friend. When Tony visits Maria at Madame Lucia's Bridal Shop at closing time, it becomes evident to Anita that Maria and Tony have begun a clandestine romance, and while she doesn't fully approve, she is persuaded by Maria to tell no one, especially Bernardo.
After the rumble, during which Bernardo is killed by Tony, Anita is in mourning and warns Maria to leave Tony and find someone else, preferably someone of her own race, but when Maria reminds Anita of her love for Bernardo and points out that when you're in love, right and wrong don't matter, Anita begins to understand Maria's situation. When Lieutenant Schrank arrives to question Maria about the flare-up at the dance, Maria sends Anita to Doc's to give Tony a message that she will be a little late in meeting him there, but when Anita arrives at Doc's, the other Jets (except for Ice, their new leader, who is not there) assume she's working for Chino and refuse to either hear her out, or believe otherwise, and begin harassing her and come very close to raping her until Doc arrives and stops them. In anger, Anita states that Bernardo was right in hating them and, instead of relaying Maria's message, tells them to tell Tony that Chino shot and killed Maria when he found out about them; in so doing, Anita's action sets the final act of the tragedy into motion.
"Bernardo was right. If one of you was lying in the street bleeding, I'd walk by and spit on you!" - Anita to the Jets