You gain a network who will push your startup, introduce you to customers, investors, partners, media, you get some knowledge shared from people in the same situation, tools and methods they used and sometimes its just comforting being part of a group of people in the same situation who you can all relate with.
obviously a lot of this comes as part of the package with YC, imo one of its biggest attractions.
(and obviously this definitely cannot be done in place of building a product / talking to customers)