Soft, child-friendly term for 'old grandfather figure' — used the way English-speaking kids might say 'gramps' or 'old gent'. Notable compound: 圣诞老公公 (Shèngdàn lǎogōnggong) is the Taiwan/southern term for Santa Claus (the mainland prefers 圣诞老人).
history
In Ming and Qing court novels and dramas, 老公公 is the polite term used to address senior eunuchs — for example throughout 《红楼梦》 (Dream of the Red Chamber). Modern speakers using the term in this sense are almost always quoting period drama.