The primary function of depositories such as CDSL and NSDL is to transform tangible securities into digital formats and store them in investors' demat accounts, facilitating secure and electronic management of investments.