Crossdressing refers to the wearing of clothing and other accoutrement commonly associated with the opposite gender of the dresser.
The presence of crossdressing in Japanese pop-culture can be construed as the result of the popularity of Kabuki theater that originated as a style of dance drama performed by female troupes in Japan in the early 17th century. In 1629 women troupes were banned from performing due to their increasingly erotic nature and prostitution of the actresses. To accommodate for the ban, male actors performed both male and female parts.
In anime and Japanese video games, crossdressing by males is often used for comical purposes. Unlike in western culture, it is not taboo for a male character to crossdress and carries less stigma of sexual orientation or questionable morals, although the act is still considered odd/perverse, hence the comedy.