This question comes up a lot in my world. I've spent a lot of time thinking about attraction, as it is the precursor to most relationships, whether they be sexual, friendships, or dealing with your nemesis.
There are two kinds of attraction. The first kind is the spur-of-the-moment rush that you get when you first see someone, or talk to them, or otherwise experience them for the first time. For the sake of argument, let's call this impulse attraction.
The second kind is an attraction that builds over time, like with a friend who gradually you fall in love with. Let's call this one graded attraction.
Graded attraction is more of a learned behavior. It's kind of like getting used to the water while swimming: at first it's very cold, but gradually it becomes comfortable and enjoyable. In this case, you may not be instantly attracted to someone, but as you get used to them, they turn out to have traits that you like and eventually enjoy. And really, it's a good basis for a relationship, whatever that relationship turns out to be. It's comfortable.
Impulse attraction is the one that most everyone is familiar with. This is the one that smacks you upside the head and makes you think all sorts of crazy things. It is the attraction of romance novels and teenage crushes.
But what makes it happen?
Let's go back to the way our brains are formed. We learn by association. In the primitive sense, as we are developing, we learn to associate certain sensory stimuli with pleasure (like mommy's boob makes our tummies full), so we get a positive reinforcement of that connection. It actually causes the physical formations of the brain to change as we are developing. Other connections form. The visual sense of the mother's face becomes connected with pleasure and comfort; the tactile sense of a soft blanket becomes attached to sleepy snuggles; the smell of something hot becomes associated with pain.
As we become more sophisticated, we learn to develop more layers of abstraction. We learn that hot things burn, even if the thing that is hot is something that we've never touched before. We make an abstract association, and form a concept of "hot". This follows more and more until we have a deeply nested network of abstract concepts that we connect and disconnect in a process we call thought.
Most of the concepts start off as primitives based on sensory input. For instance, when I say "hot", your brain describes a mental image to you taht may consist of a tactile sense (touch), visual sense (fire), a smell (hot metal), and perhaps others. Those images are wired together through the abstract concept of "hot", but a lot of the same images can be associated to other things, like the image of a fire can be a warm comforting fireplace shared with a loved one.
But not all associations are consciously made. Sometimes those things that seem completely unconnected get circuited through an association network, and unconciously become tied together. For instance, I have an irrational fear of stinging insects. I am not allergic to them as far as I know, but if I am attacked by bees (or hornets or wasps), I go into a complete and utter blind panic. Why this happens I don't know, and knowing about it doesn't help much at all.
So impulse attraction comes down to two things: sensory input and association. Something that you see, or hear, or smell when you first meet someone gets routed through one of those obscure childhood connections that you made while you were becoming a person, and it clicks. It's akin to the irrational fear, but instead of fear, it's pleasure, or excitement, or tittilation.
A narrow sense of this is sexual attraction. This is a slighly different beast, because it is narrowed into the realm of sexualization. As children, we all became aware of differences between the plumbing of boys and girls, but probably before that we learned the pleasure of touch "down under". From the moment that we first discover the new toy we have, we start the process of sexualization, and start making connections to the environment that surrounds us as we discover the ability to give ourselves pleasure.
During puberty though, the pleasure changes. It becomes more intense and involving, and the social pressures become uncomfortable and weird as our bodies change. We become extremely susceptible to creating really funky associations with the mix of pleasure and embarrassment that comes with becoming a sexual being. And sometimes it can really screw us up, like becoming sexually aroused around peanut butter or the smell of diesel fuel.
So we walk around with all these abstract connections swimming around in our brains, and suddenly we are struck by a sight or a sound or a smell that triggers one of these nodes, and suddenly we are flooded with arousal. Maybe not to the point of laying on the ground and writhing or anything, but there is something there, a chemistry that is undeniable.
Television thrives on this. Television advertising is all about trying to make associations for you. It tries to pre-digest the association and get your arousal centers all worked up over a new car, or piece of jewelry, or a burger. And it works. Scary as it may seem, you are being programmed to see what others want you to see as "attractive". The association works both ways. Showing a sexy woman enjoying herself in a new sports car not only helps sell the sports car, it helps sell the woman as well. Many actors got their starts doing TV commercials. As they become more and more popular (an example of graded attraction, BTW), your sense of what is attractive changes slightly to accommodate them.
Hopefully, as we become adults, we learn to take more control over our psyche, and actively work toward finding attractiveness in other things. Strength, honesty, integrity, intelligence, the ability to communicate. But it's hard not to get smacked upside the head every once in a while. It's only human.
So here's your bit of homework: what do you find attractive, and why? And when you find yourself attracted to someone on impulse, what specifically draws you to them?