I am trying to understand the use of composite primary key or two primary keys in a table
It comes in handy especially when combining with foreign keys ... 

imagine having 3 tables 

T1
ID, data1, data2
T2
ID, data1, data2
T3
T1id, T2id, data3, data4


the ID column for T1 and T2 is obviously primary key - but what about table T3 - we could define another ID column to make a primary key .. OR just define the combo of T1id and T2id as the primary key ... but this depends on what data you hold in your tables and what relationship they contain
but especially when T3 was used to store a M:N (many : many) relation it makes sense to use a composite primary key consisting of T1id and T2id.