ある ‘some’ is an obvious rentaikei of the verb 有り, ‘to exist’, and its emergence as a pronominal is due to the kanbun influence of Chinese 有 ɦuwX ‘same’ (Zisk, M. (2018). Middle Chinese Loan Translations and Derivations in Japanese. Japanese/Korean Linguistics, 24. p. 323).

But what is と in the extended form, とある ‘some, certain’?

Martin, S. E. (1987). The Japanese language through time (p. 397). New Haven: Yale University Press is silent on that. Iwanami Kogo Jiten just claims the word exists and gives example, no etymology.