I need to know the details about how an EPUB is written, where i can get the official specs? Which is the entity that cares about the EPUB format?
The specifications are here.
The organisation that controls it is International Digital Publishing Forum (IDPF) as noted in the epub tag wiki