Two years ago, a 7-year-old girl named Charlotte wrote a letter to the toymaker Lego with a straightforward request.

“I love Legos,” she wrote, “but I don’t like that there are more lego boy people and barely any lego girls.” The girls in the Lego universe, Charlotte had noticed, seemed preoccupied with sitting at home, going to the beach, and shopping—while the boys had jobs, saved people, and went on adventures.

Charlotte, Lego acknowledged, had a point. “It’s fair,” said Michael McNally, a Lego spokesman who says the company receives letters from kids all the time. “Why wouldn’t there be more female representation?”

Years before Charlotte sent her letter, Lego was already keenly focused on how girls perceived the brand. It was 2008 when the toymaker decided to gather global data about who buys Legos. What they found was startling. In the United States, roughly 90 percent of Lego sets being sold were intended for boys. In other words, there was a huge untapped market of girls who weren’t building with Legos.

“Seeing that the play pattern was really skewing so heavily toward boys, we wanted to understand why,” McNally said. “We embarked on four years of global research with 4,500 girls and their moms. Some of the things we heard were really surprising and challenging in ways that weren’t really comfortable for us as a brand.”

Namely, Lego found that girls and boys played with Legos differently from one another. They consistently had distinct ideas about how to interact with the same toys they encountered—expectations that seemed to be drawn along gender lines in focus group after focus group. Lego had stumbled into a dynamic that’s as familiar as it is controversial; the idea that boys and girls, from a very young age, construct starkly divergent worlds for play.

There’s much academic research to back up the notion that girls and boys gravitate toward different toys. And babies as young as 18 months old show gender-related behaviors when playing with certain toys, differences that persist throughout childhood. Further research shows the perceived gender of a toy itself can have “significant impact on toy preferences and exploration,” wrote the authors of a 2003 paper, published in the journal Educational Pscychology, about how children play with toys. Kids routinely favor the toy they believe is meant for them, based on their gender. But the decision matrix that ultimately influences widespread views on which toys are for which children includes inputs from parents, kids, and toy makers—adding up to a system that produces something of a feedback loop.

Researchers have found that toys judged to be most appropriate for girls tend to be seen as attractive, creative, nurturing, and “manipulable,” whereas toys that are seen as being appropriate for boys are viewed as more competitive, aggressive, constructive—designed to encourage sociability and to reflect reality. Boys are more likely to be given vehicles, balls, and toy guns, while girls are more likely to get domestically oriented toys like baby dolls and tiny vacuum cleaners. In another study, published in 1986, researchers found dozens of children, aged 4 to 9, interacted more with the toys that had labels corresponding to their own genders—and remembered more details about those toys one week later.

Kids also tend to believe that their gender preferences are innate. “Once children learn that being a boy or a girl is important, they come up with their own, often inaccurate, explanations about how and why boys and girls differ,” wrote Christa S. Brown on her Psychology Today blog, Beyond Pink and Blue. “They assume boys and girls are different in deep, fundamental ways. They assume that culturally specific traits, like wanting to sew or be a firefighter, are innate and biologically driven. Unfortunately, once these stereotypes are in place, they are difficult to change unless you address them head on.”

This may help explain why, even when children are given the same toys, girls and boys often play differently. These aren’t just incidental dissimilarities, either. The toys kids choose, and how they choose to play with them, “have long term consequences for later social and cognitive development,” wrote the authors of the 2003 paper. In other words, differences in how kids play have real-world consequences for children as they grow up.

But what exactly are those differences? And where do they come from?

Though these two questions are interconnected, the first one is much easier to answer than the second. To see how boys and girls play, you just have to watch them do their thing. That’s what Lego did over the course of its research in past decade. For one project, Lego gathered a group of boys and asked them to build a Lego castle together. Separately, they gave the same task to the group of girls. Both groups worked together to build the castle, but once it was assembled, there were stark differences in how the two groups proceeded.

“The boys immediately grabbed the figures and the horses and the catapults and they started having a battle,” McNally said. “The facilitator said, ‘What about the castle?’ And they said, ‘Well, that’s just the backdrop for the battle.’”

The girls, on the other hand, were more focused on the structure—and not too impressed with what they found. “They all looked around inside the castle and they said, ‘Well, there’s nothing inside,’” McNally said. “This idea of interior versus exterior in the orientation of how they would then play with what they built was really interesting. If you think about most of the Lego models that people consider to be meant for boys, there’s not a whole lot going on in there. But [the girls had] this idea of, ‘There’s nothing inside to do.’”

“Both girls and boys were saying they liked building, but there were nuances in what they were looking for,” he added. “We heard girls overwhelming saying we would much rather build environments than single structures. They were really just looking for a lot more detail than we were offering.”

So Lego decided to offer something new. In 2012, the toymaker launched Lego Friends—stylized on boxes with a heart dotting the “i,” and a butterfly hovering nearby—a new line designed for girls. The Friends line includes a pop star’s house, limousine, TV studio, recording studio, dressing room, and tour bus; a cupcake cafe; a giant treehouse; a supermarket; and a hair salon, among other construction sets. (A science lab that was part of the Friends line, which included a pet robot and tiny microscope, is now listed on the Lego site as “retired.”)

From the beginning, Lego Friends sparked a vocal debate. NPR asked, “Why Do Girls Need Special Legos?” A writer for The New York Times lamented Lego’s designs, which she said looked “far more Polly Pocket than Lego Hermione Granger.”

“There were a lot of people at the beginning who said, ‘They’ve dumbed it down, it’s not nearly as complicated [as the original Legos], it’s special for girls because they don’t think girls can build,’” McNally told me. “The reality is, just about piece for piece, there are just as many pieces required to put something together [among Friends sets].”

“There are some nuances,” he added. “One of the things we learned in the research was that—where boys were perfectly happy going through two hours assembling a single structure—girls were much more interested in small bite-sized assembly that provided a role-play opportunity, before then building again.”

But some of the complaints about Lego Friends have been nuanced, too. Tens of thousands of people signed a petition complaining about the message that Lego Friends subtly sends to children about what girls should value. The Campaign for a Commercial-Free Childhood nominated Lego Friends for a TOADY award, a “worst toy” designation that’s also a partial acronym for “Toys Oppressive And Destructive to Young Children.” Here’s how the advocacy group described Friends at the time:

How do you turn one of the all-time great toys into a TOADY contender? Give it a makeover! Introducing LEGO Friends, just for girls and so jam-packed with condescending stereotypes it would even make Barbie blush. Bye-bye square, androgynous figures; hello, curves ‘n  eyelashes! And at the LEGO Friends Butterfly Beauty Shop, your little princess won’t need to worry her pretty little head about icky boy things like building.

Lego has attempted girl-focused product lines several times since the 1970s, beginning with a collection known as Lego Homemaker in the 1970s. “None of them really have stuck. There were good reasons for that,” McNally said.

But Lego Friends was different. The line was a smashing success from the start. Lego’s profits have soared in recent years. The toymaker’s growth has averaged 15 percent annually since Friends debuted. Last year, it pulled in more than $5.4 billion in revenue—up 25 percent compared with 2014, according to data provided by Lego. McNally declined to tell me exactly how Lego sales had shifted along gender lines since 2008, when just 10 percent of purchases were intended for girls, and would only say the share of toys bought for girls now represent “significantly more” of overall Lego sales than they did eight years ago. To Lego, there are two successes here: The obvious monetary gain, and the reason for it—which is that girls are finally flocking to Lego. The fact that they’re embracing a non-traditional Lego product doesn’t make a difference, McNally says.

“I think there’s been a lot of momentum around this idea that everything should be gender neutral,” McNally said. “That’s not what we’re striving for. We don’t see anything wrong with the natural ways that children are choosing to play. We try being gender inclusive.”

The idea of “natural” ways of playing, though, brings us to a trickier question: What is it about Lego Friends that makes so many girls excited, some of the same girls who are blasé about traditional Lego building kits? Perhaps a better question is this: What made the adults who buy Legos pick up Friends, but not old-school Legos when they’re shopping for little girls? The new line’s popularity among kids and grown-ups alike probably stems from some of the same features that have made some people so angry about Lego Friends. Namely, that the line is stereotypically girly.

For some parents, girls’s embrace of Friends has created a catch-22. Sharon Holbrook, writing for The New York Times, described feeling conflicted about her 7-year-old daughter’s delight with the toys.

[M]y daughter, who had regarded her brother’s Lego with only intermittent interest, greeted the candy-bright Lego Friends like the appearance of a choir of heavenly angels. She loved the minifigure animals. She loved the stories and characters. She loved the pretend-play possibilities of having a Lego ice cream parlor or a Lego house. As much as I prefer the whole image in the gender-neutral 1981 Lego ad, I was glad she was building, and I was glad she was stretching her imagination, even when she was snapping together Lego pieces that were overwhelmingly pink and purple. I gave Lego credit.

Holbrook was cautiously optimistic about Lego Friends—that is, until Holbrook’s little girl came to her with a question. “My 7-year-old wants to know if she has an oval face,” Holbrook wrote. It turns out her child had been reading a recent issue of Lego Club Magazine, aimed at kids between the ages of 5 and 12, which included advice from one of the Lego Friends characters about which haircuts are most flattering. “She is 7,” Holbrook wrote. “My little girl, the shape of her face, and whether her haircut is flattering are none of Lego’s concern. It wasn’t even her concern until a toy magazine told her to start worrying about it.”

“LEGO execs,” Carolyn Cox later wrote for The Mary Sue, “I sentence you to a lifetime of stepping on bricks of your own creation.”

Meanwhile, Lego continues to expand its offerings. Last year it introduced a line of toys called Lego Elves, which includes jewel-toned figures—not to be confused with the classic yellow Lego mini-figurines, a distinction that’s a sticking point among critics—dragons, and other fantastical elements. Like Friends, Elves is marketed to girls, and McNally describes it as one of several gateways to broader Lego play. “I think of the intention is starting to reveal that girls—who have entered the Lego universe, whether it’s through Friends or Disney Princess or Elves, more and more are starting to explore beyond [those lines].”

For a company hoping to sell more Legos, it’s understandable that the goal would be to have more kids playing with more products. But McNally’s framing—Friends and Elves and princesses as jumping-off points—also arguably reinforces the idea that Legos “for girls” are ancillary. Despite what girls are often told, there’s nothing lesser about preferring pastel colors to primary ones, or opting to play inside a castle rather than waging a pretend war on its front lawn. “Wanting to wear tutus does not mean you can’t grow up and be a rocket scientist,” Malorie Catchpole, the co-founder of the science-oriented girls clothing line BuddingSTEM, told me earlier this month.

And, for what it’s worth, I adored Polly Pocket as a kid—not, that I’m aware of, because it was made “for girls,” but because the toys were portable, ultra-detailed little worlds that offered a simultaneously self-contained and totally open-ended universe for storytelling. I loved Playmobil for similar reasons. But I never really got into Legos. Maybe I would have loved Lego Friends if they’d been around in the 1980s.

To me, the problem with Lego Friends, if there is one, seems to be in the marketing more than the toys themselves—but the trouble is that the messaging is in many ways inextricable from the product. If Lego wants to convey the idea that any kid can play with any of its products, for example, it’s strange that Friends are found on the Lego website under a subhead “Girls,” the implication being that the rest of the site is not for girls. (And that girls themselves are in a subcategory of children.)

Although Target last year announced it would stop selling toys in designated “boys” and “girls” sections, many other stores and websites still organize products this way. “I went to a store and saw legos in two sections,” Charlotte, the 7-year-old Lego fan, wrote in her letter to the company. “The girls pink and the boys blue.”

“It’s not necessarily the reality we like,” said McNally, the Lego spokesman. “But when you’re talking about toys you’re always talking about the difference between getting the consumer interested and engaging the shopper, who actually brings the item into the home. So what kids are willing to see as for girls, or for boys, or both—shoppers look at it differently.”

Lego hasn’t been able to shake the perception that original Legos are for boys. (Arguably, it really hasn’t tried.) Friends, not surprisingly, hasn’t helped. “When you talk to moms in particular, they say, ‘I just wouldn’t even think to get Lego for my daughter,’” McNally told me. “The reality is that for them to even know that it’s available, you should put it in the girl aisle because that’s where they go.”

At the end of the day, Lego is just trying to sell products that kids want. They may be philosophically all-inclusive, but marketing to girls and boys separately is pretty good business sense, too. If girls suddenly love your products as much as boys do, your sales ostensibly double.

And anyway, adults are often the ones telling kids what they should like. Boys, it turns out, get more negative feedback for perceived cross-gender play, like feeding dolls, than girls do, according to that 2003 study. Its authors worked with 30 children—most of them white and from middle-class families—and had them explore a playroom that had about the same number of toys that would be stereotyped as masculine, feminine, or gender neutral. The room contained a kitchen set, a miniature farm, a toy house, dress-up clothes, blocks, crayons, dolls, puzzles, a plastic phone, a shape sorter, and so on. Children were instructed to play with whatever toy they wanted, and each child’s playing was videotaped for later analysis.

To the researchers’ surprise, the girls didn’t predominantly play with female-stereotyped toys. Half of the top 10 favorites among girls were considered “neutral toys,” meaning these were the objects that kept the girls’s interest longest. The boys acted more in accordance with what the researchers had anticipated, playing with male-stereotyped toys about half of the time. Among all the kids, the toys that were stereotyped as “feminine,” including a pretend kitchenette and the doll areas, elicited more complex forms of play.

For all the research that’s been done, and for all the emotion that gender-specific toys elicit, people still don’t fully understand the elaborate forces that shape toy preferences or even the dynamics of play. Companies like Lego say they’re just giving girls what they want. Critics say Lego is actually shaping what girls want, and likely to harmful effect. The reality for children is probably somewhere in the middle. And children, for better and worse, tend to simplify these complexities.

Charlotte, the little girl who wrote to Lego several years ago, concluded her letter thusly: “I want you to make more lego girl people and let them go on adventures and have fun ok!?! from Charlotte. Thank you.”