What is a framework?
In computer programming, a framework is like a toolbox providing abstract/concrete/generic functionalities. It is a standard way to create/build/deploy code/applications and this box is standardized, universal and reusable.
It facilitates the development of applications/products/solutions providing tools to be used even regardless of the language used.
A framework may include predefined classes, functions, methods... that can be used to process data, input, interact with third parties like system software, hardware… it is an essential supporting structure in building applications.
What is the goal of a framework?
It streamlines the development process, helping programmers to not reinvent the wheel each time they need a functionality. It helps reducing the time spent by programmers for common/most used functionalities. It serves as a foundation for programmers and may also provide code libraries and compiler.
Frameworks provide Software development kits (SDKs) which include programming tools designed specifically for the corresponding framework.
The framework will be supported natively by an operating system (OS) like Windows (Microsoft .Net Framework, ActiveX…), Android (Android Application Framework), iOS (Cocoa).
Generally, frameworks refer to broad software development platforms but the term itself can be used to describe a specific framework within a larger one. Java has multiple frameworks such as Spring but the Java Collections Framework (JCF) can be used to create Java software. Apple has also multiple frameworks for OS X programs.
Remember also that the code in the framework has been developed by a certain number of programmers so it has been tested, optimized and is probably a lot more efficient than the code a programmer can write. The programmer can, therefore, focus on the high-level software, high-level functionalities and not worry about this low level stuff provided by the framework.