[noun] + が + [verb て-form] + ある [noun] + を + [verb て-form] + ある
てある describes a state someone left on purpose: a transitive verb in the て-form plus ある. The thing acted on takes が, and the person who did it is not mentioned.
The verb has to be transitive – one that takes を. An intransitive verb describes its state with ている instead.
Most verbs here come in pairs: あける開ける and ひらく開く, しめる閉める and しまる閉まる, つける and つく, かける and かかる, いれる入れる and はいる入る. The transitive one with てある says someone did it deliberately. The intransitive one with ている only reports the state.
A transitive verb with ている is an action in progress, with を: まど窓をあけている開けているis "someone is opening the window". With が in front it makes no sense.
てある often says a job has been done ahead of time, ready for what comes next. Here the object can keep を, and the doer is usually the speaker.
Getting a job done ahead of time is ておく. てある reports that it is done and the result is still there.