Extension's variables: global and scene related questions

How do the scene and global variables in extensions work?

Are these variable stored in the scene at which the extension’s functions/objects/behaviors are used? Same question regarding global variables: when do they come to life, when an element of an extension is used? Are they stored globally in the project?

They work the same as variables from the main events but only the extension can use them.