We rarely see an isolated visual stimulus all alone by itself. Rather, the stimulus tends to be surrounded by spatial and temporal context, which often affect both the perception and cortical responses to the target stimulus. The contextual information in fact can be fairly rich, and its effects can be very complex, which in many cases have not been fully explored. This thesis uses functional magnetic resonance imaging (fMRI), psychophysics, and computational modeling to examine the effects and functions of the contextual modulation especially beyond local features. In Chapters 2 and 3, two sets of experiments considering a larger context including the global shape complexity and figure-ground segregation are used to reconcile competing branches of the literature in terms of the cortical response patterns of early visual areas. In particular, those cortical responses to coherent structure-from-motion stimuli or circular contours vary dramatically depending on the global context. In Chapters 4 and 5, two sets of psychophysical experiments use the tilt illusion and the shape distortion, respectively, as probes to further explore the functions of local and global context. Overall, the ability to take account larger context ensures the system would dynamically adjust weights between an efficient representation and a strategy to emphasize targets and indicate certainty in early visual areas. Additionally, a stronger perceptual grouping cue between the target and its surround or a larger uncertainty of the center target would enhance the contextual modulation and increase perceptual biases, which would potentially increase the sensitivity of visual system to feature discrepancies, and it would play an important role in visual search and detection.