Hi,
BKPF table is for header data info of accounting document.
BSEG table is for item level info of accounting document.
BSIM table is for storing secondary indexes info of accounting document, to know more about this refer below help link.
http://help.sap.com/saphelp_erp60_sp/helpdata/en/8d/3e51be462a11d189000000e8323d3a/content.htm
Regards
Vijay